Boolean algebra

Boolean algebra and truth tables can be used to describe logical expressions. The most common Boolean operators are AND, OR and NOT (always in capitals). Each operator has a standard symbol that can be used when drawing logic gate circuits.

An explanation of NOT, AND, OR and XOR logic gates

NOT gate

curriculum-key-fact
A NOT gate has just one input. The output of the circuit will be the opposite of the input. If 0 is input, then the output is 1. If 1 is input, then 0 is output.
NOT gate symbol: triangle with a circle on the point, with one input (A) and one output (Q)

If A is the input and Q is the output, the truth table looks like this:

AQ
10
01

The Boolean expression is written as Q = NOT A.

AND gate

curriculum-key-fact
An AND gate can be used on a gate with two inputs. AND tells us that both inputs have to be 1 in order for the output to be 1.
AND gate symbol: a semicircle with two inputs (A&B) and one output (Q)

The truth table would look like this:

ABQ
000
010
100
111

The Boolean expression is written as Q = A AND B.

OR gate

curriculum-key-fact
The OR gate has two inputs. One or both inputs must be 1 to output 1, otherwise it outputs 0.
OR gate symbol: a semicircle with a concave side, with two inputs (A&B) and one output (Q)

The truth table would look like this:

ABQ
000
011
101
111

The Boolean expression is written as Q = A OR B.

XOR gate

curriculum-key-fact
The exclusive OR gate works the same as an OR gate, but will output 1 only if one or the other (not both) inputs are 1.
An XOR gate looks like an OR gate, but with an extra line across the inputs

The XOR gate is indicated with the extra curved line to the left of the main shape.

The truth table would read like this:

ABQ
000
011
101
110

The Boolean expression is written as Q = A XOR B.