Boolean logic
Boolean logic uses two values — true (1) and false (0) — and three fundamental operations: AND, OR, NOT. Real CPUs are built from millions of gates implementing these operations. AQA expects you to construct truth tables, draw circuits, and write Boolean expressions.
The three gates
NOT (inverter)
One input, one output. Output = the opposite of the input.
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
Symbol: a triangle with a small circle at the output.
AND
Two inputs, one output. Output = 1 only if both inputs are 1.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Symbol: a D-shape (flat input side, rounded output side).
OR
Two inputs, one output. Output = 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 |
Symbol: a curved-back shield.
Building expressions
Combine gates to build any logic. Operator precedence (highest first): NOT, AND, OR — like arithmetic's BIDMAS.
A AND (NOT B) -- A and the inverse of B
(A OR B) AND C -- at least one of A, B, AND c is 1
NOT (A AND B) -- NAND — at least one is 0
Truth tables for compound expressions
Build a truth table by enumerating all combinations of inputs (2ⁿ rows for n inputs), then computing the expression column by column.
Worked example: (A AND B) OR (NOT C).
| A | B | C | A AND B | NOT C | (A AND B) OR (NOT C) |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Circuit diagrams
To draw the circuit for (A AND B) OR (NOT C):
- Three input wires labelled A, B, C.
- Pass A and B into an AND gate.
- Pass C through a NOT gate (inverter).
- Feed the AND-output and the NOT-output into an OR gate.
- The OR gate output is Q.
Simplifying expressions
You don't need to know full Boolean algebra at GCSE, but recognise simple identities:
A AND 1 = AA AND 0 = 0A OR 1 = 1A OR 0 = AA AND A = A;A OR A = AA AND (NOT A) = 0A OR (NOT A) = 1NOT (NOT A) = A(double negation)
Real-world meaning
Each gate corresponds to a physical electronic component made of transistors. A modern CPU contains billions. Boolean logic is the mathematics of digital design — every program runs as Boolean operations on bits.
⚠Common mistakes— Pitfalls
- Reading the wrong column. With 3 inputs you have 8 rows — write them out systematically (binary count 000 to 111).
- Mixing up AND and OR. AND needs all 1s; OR needs at least one 1.
- Forgetting NOT first.
A AND NOT Bmeans A AND (NOT B), not NOT (A AND B). - Drawing decisions in flowcharts as logic gates. They're different conventions — a flowchart diamond is a decision; a logic-gate diagram is a circuit.
- Putting NOT in the wrong place in a circuit. A NOT gate (small circle) inverts whatever wire it sits on.
✦Worked example— Worked example — security door
A door unlocks if the user has a valid keycard AND knows the PIN, OR if the override switch is on. Let K = keycard valid, P = PIN correct, S = override switch on.
Q = (K AND P) OR S.
Truth table (8 rows): unlock (Q=1) when both K and P are 1, OR whenever S is 1.
➜Try this— Quick check
Complete the truth table for NOT (A OR B):
| A | B | A OR B | NOT (A OR B) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
This is NOR — output is 1 only when both inputs are 0.
AI-generated · claude-opus-4-7 · v3-deep-computer-science