Boolean logic: AND, OR, NOT gates and truth tables
Boolean logic is tested on every OCR J277 Paper 2. Expect truth table questions (completing a table for a given circuit), circuit diagram questions (draw the gates for a Boolean expression), and expression questions (write the expression for a circuit). These are reliable marks — learn the rules.
Basic logic gates
NOT gate (inverter)
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
- Inverts the input. If A is true (1), NOT A is false (0). Written: ¬A or NOT A or A'.
AND gate
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
- Output is 1 only if both inputs are 1. Written: A AND B or A · B.
OR gate
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
- Output is 1 if at least one input is 1. Written: A OR B or A + B.
Combined gates — worked example
Expression: NOT (A AND B) OR C
Step 1: Evaluate A AND B. Step 2: Apply NOT to that result. Step 3: OR the result with C.
Full truth table (A, B, C all possible combinations — 8 rows for 3 inputs: 2³):
| A | B | C | A AND B | NOT(A AND B) | NOT(A AND B) OR C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Drawing logic circuits
- NOT: triangle with a small circle at the output.
- AND: flat-backed D-shape gate.
- OR: curved D-shape gate (input side concave).
Wires connect inputs → gates → output.
Common OCR exam mistakes
- AND gate confusion: "both inputs must be 1" — even 1+0 gives 0. Only 1 AND 1 = 1.
- NOT applied after the gate (NAND-like result) — read expressions carefully for brackets: NOT(A AND B) ≠ NOT A AND NOT B.
- Row count for truth tables: 2 inputs → 4 rows (2²); 3 inputs → 8 rows (2³). Always list binary in order (000, 001, 010, 011, …).
- Writing the wrong number of columns — include intermediate columns for each gate in the expression.
AI-generated · claude-opus-4-7 · v3-ocr-computer-science