AND, OR, NOT — the same ideas as and / or / not in Python, drawn as gates and truth tables. Short unit. High value per minute.
2.4.1 Boolean logic
The three operators
Treat 1 as True, 0 as False. OCR accepts T/F as well.
NOT — one input, flips it.
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
AND — 1 only if both inputs are 1.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR — 1 if at least one input is 1.
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
This is inclusive OR (1 OR 1 is 1). Not “exclusive or” unless they say XOR (they usually do not at GCSE).
Combining
Work inside brackets first, same as maths. A common pattern:
Q = (A AND B) OR (NOT C)
Build a truth table with columns for every sub-expression, not just inputs and final Q. That is how you avoid losing a mark on row 6 of 8.
For 3 inputs there are 2³ = 8 rows. List them in binary counting order (000, 001, 010, …) so you do not skip.
Logic diagrams
Standard gate shapes (practice drawing them):
- AND — D-shape
- OR — curved input side
- NOT — triangle with a bubble
Wires from inputs on the left to output on the right. A dot on a join means a connection; crossing without a dot is not a join.
You must go both ways: table → diagram, diagram → expression → table.
Link to programs
if logged_in AND (role == "admin" OR debug): is the same Boolean as the gates. If you can trace the if, you can fill the table.
Exercises are “complete the table” and “write the expression”. Reveal the model; then invent one of your own with three inputs.