Logic gates
The building blocks of logic
- A logic gate is a tiny circuit that does one Boolean operation.
- Every input and output is 0 (false) or 1 (true).
- Learn each gate's symbol, its function, and its truth table.
The six gate symbols
- You must recognise all six: NOT, AND, OR, NAND, NOR, XOR.
- NAND is "NOT AND", NOR is "NOT OR" — the little circle (bubble) means "invert the output".

NOT, AND, OR
- NOT flips the input. AND is 1 only if all inputs are 1. OR is 1 if at least one input is 1.
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
(NOT: 0→1, 1→0.)
Practice
A NOT gate outputs 1 when its input is 0.
NOT inverts: 0 → 1 and 1 → 0.
Practice
An AND gate outputs 1 when:
AND outputs 1 only if every input is 1; otherwise 0.
Practice
An OR gate outputs 0 only when:
OR is 1 if at least one input is 1, so it is 0 only when every input is 0.
NAND, NOR, XOR
- NAND = NOT AND (0 only when all inputs are 1). NOR = NOT OR (1 only when all inputs are 0). XOR = 1 when the inputs are different.
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
Practice
A XOR gate outputs 1 when:
XOR (exclusive OR) is 1 when the inputs differ (0,1 or 1,0) and 0 when they are the same.
Practice
A NAND gate outputs 0 only when:
NAND = NOT AND, so it is 0 exactly when AND would be 1 (all inputs 1), and 1 otherwise.
Practice
A NOR gate with both inputs 0 outputs what value (0 or 1)?
NOR = NOT OR. OR of (0,0) is 0, so NOR is 1. NOR is 1 only when all inputs are 0.
You've got it
Key idea
- a gate does one Boolean operation on 0/1 inputs
- AND = all 1s · OR = any 1 · NOT = invert
- NAND/NOR = AND/OR with the output inverted (the bubble)
- XOR = 1 when the inputs differ