The six logic gates. NOT · AND · OR · NAND · NOR · XOR. Every symbol, every truth table, every expression. The mechanics before the composition.
Every digital device you own runs on electricity at one voltage. But binary needs two states — 0 and 1. Logic gates are the tiny switches that translate one into the other. They are the atoms of computation.
In this lab you'll meet the six standard logic gates of the Cambridge 0478 syllabus: NOT · AND · OR · NAND · NOR · XOR. For each one you'll learn the symbol, the behaviour, the truth table, and how to write it as a logic expression.
This is the mechanics lab. Lab B composes gates into circuits. Lab C applies circuits to real-world problems. But none of that works until the six gates are cold.
"The gate fires. The signal responds." Each gate is a switch. You put signals in. You get a signal out. Every gate has its own rule for which combinations of inputs turn the output high.
X = A AND B) and symbolic form (X = A · B)Wording matches the textbook exactly — Cambridge marks against textbook language.
Ā = NOT A).Every gate has three things you need to recognise:
X = A AND BX = A · B (dot for AND, plus for OR, overbar for NOT)Truth tables show all four (or two, for NOT) input combinations and the output for each.
NOT has 1 input. Only one. Ever.
All other gates (AND, OR, NAND, NOR, XOR) have 2 inputs.
This is question-worthy on its own. Cambridge 0478 syllabus 10.1.d asks this directly. A NOT gate drawn with two inputs = zero marks.
| Gate | Inputs | Output = 1 when… | Word expression | Symbolic |
|---|---|---|---|---|
| NOT | 1 | input is 0 | X = NOT A | X = Ā |
| AND | 2 | both inputs are 1 | X = A AND B | X = A · B |
| OR | 2 | either or both inputs are 1 | X = A OR B | X = A + B |
| NAND | 2 | either input is 0 (or both) | X = A NAND B | X = A·B (overbar over both) |
| NOR | 2 | both inputs are 0 | X = A NOR B | X = A+B (overbar over both) |
| XOR | 2 | exactly one input is 1 | X = A XOR B | X = A ⊕ B |
Each gate as a doorway guard. Different guards, different rules. The metaphor is from the textbook and it holds — remember the guard's rule, remember the gate.
Five traps come from Cambridge Principal Examiner Reports; five come from the textbook and syllabus. Every one has a fix.
These phrases appear verbatim on Cambridge Paper 2 (Algorithms, Programming and Logic) — P21/P22/P23 under the 2023-onwards syllabus. Using them in answers earns marks.
0 / 6 revealed
You can draw the symbol, complete the truth table, and write the logic expression for any single gate in isolation.
Next up: Lab B · Circuit (Composition) — where you'll wire these gates together into circuits, convert between expressions, truth tables, and circuits, and start reading the multi-gate questions Cambridge tests every year.
Topic 10 · Lab A teaches gate mechanics. Then Lab B composes gates into circuits. Then Lab C applies circuits to real-world problems.
The gate fires. The signal responds.
The Learn tab takes the six gates and slows them down. Each one gets a diagram, an explanation, and a walk-through of its behaviour. When you're done here, head to Activities and open the Gate Trainer.
Every Cambridge gate symbol has three parts you draw:
1 · Input lines — one for NOT, two for all other gates. Labelled A (and B, for 2-input gates).
2 · The body — the shape of the gate. AND has a flat back and a D-shaped front. OR has a concave back and a pointed front. NOT is a triangle.
3 · The output line — labelled X. If the gate is a "NOT-something" (NAND, NOR, or NOT itself), there's a small bubble at the output tip.
The difference between AND and NAND is one small circle. That circle inverts every output.
Output = 1 when both inputs are 1.
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Output = flipped AND. Both 1s gives 0; anything else gives 1.
| A | B | X |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
The rule: every N-gate (NAND, NOR, NOT) has an output bubble. No bubble, no inversion, no marks. This is Trap 5 from the Review tab.
Same layout for every gate. Symbol · rule · truth table · expression. This is exactly what you'll see on the Cambridge paper.
2-input truth tables always show the same four rows, always in the same order:
| A | B | X |
|---|---|---|
| 0 | 0 | ? |
| 0 | 1 | ? |
| 1 | 0 | ? |
| 1 | 1 | ? |
Read down A first, then B. A = 0, B = 0. A = 0, B = 1. A = 1, B = 0. A = 1, B = 1. Every gate you'll ever meet uses this order. Miss a row (or put them in a weird order) and you drop marks.
2 inputs → 4 rows. 1 input (NOT) → 2 rows. Both students and examiners take a full mark off for skipped rows.
The Gate Trainer has 4 modes. Symbol → Name (easiest) walks up to Sprint (hardest). Start on Mode 1 and let the adaptive weighting surface the gates you're weakest on.
Lab A drills these Cambridge Paper 2 skills:
Not in this lab (Lab B / Lab C territory): multi-gate circuits, expression↔circuit conversion, problem-statement questions.
Four modes. Each one drills a different Cambridge exam skill. Adaptive weighting means the gates you get wrong come back more often (2× likelihood); the gates you master fade to the background (0.2×).
Sprint is 60 seconds of mixed drills — but it stays locked until you've attempted Modes 1, 2, and 3 at least once. No skipping the fundamentals.
Mixed drills from Modes 1–3. Adaptive: weak gates surface 2× more often. Streaks show at 5 · 10 · 15 correct.
One drill per gate at minimum. Weak gates surface more often.
Mode 1 · Symbol → Name. See the SVG, name the gate. Trains Cambridge P22 Q2-style symbol-recognition.
Mode 2 · Name → Truth Table. See "XOR", fill in the 4 output cells in Cambridge order. Trains 10.2.a.
Mode 3 · Inputs → Output. See gate + specific A/B, predict X. Trains gate-behaviour recall.
Mode 4 · Sprint. 60s mixed drill for exam speed.
Weighting adapts to your accuracy: weak gates come back 2× as often, mastered gates fade to 0.2×. Filter by difficulty or run the whole pool. Missed questions log automatically to Mistakes.
Every question traces to a real Cambridge Paper 2 (Algorithms, Programming and Logic — P21/P22/P23 under the 2023-onwards syllabus) or earlier Paper 1 for pre-syllabus material. Write your answer, then self-mark against the mark scheme.
Topic 10 lives on Paper 2 under the 2023-onwards 0478 syllabus (Algorithms, Programming and Logic). 2022 items reference Paper 1 because that was pre-syllabus-change. E12 is a synthetic exam-style composite.
Cambridge Principal Examiner Reports call out the same mistakes every year. Read these before your exam. Then look at Mistakes to see the ones you keep making.
Six one-liners. If you can recite these before your exam, you know the six gates.
Tick each item as you master it. Tap any status chip to manually override (respects student autonomy — per Master Prompt Pack). When all 12 are ticked, the Module Mastered banner unlocks.
Mastered = 3+ attempts and ≥70% accuracy. Tap the status chip to manually override.
Every wrong Practice/Exam answer captures here automatically. Review before your next attempt.
Your attempts, accuracy, and mastery counts across Lab A.
Star an exam question to save it here.
Jot notes as you learn. Feedback goes to the FL team.
Sent mistakes, saved concepts, and things you want to keep. Search across everything.