Syllabus & Goals 3 min
Cambridge 10.1 · Logic gate symbols and functions Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Draw the symbols for NAND, NOR and XOR and complete their truth tables.
- Describe the function of all six gates in words.
- Identify a single gate from its truth table.
Textbook: Chapter 10, §10.2.4–10.2.6 (pp. 359–360)
Recap / Warm-Up 5 min
Last lesson you met NOT, AND and OR, and learned that n inputs give 2n truth-table rows.
Quick starter
Complete from memory: the output column of an OR gate for inputs 00, 01, 10, 11. Then invert every value. What pattern do you get?
Reveal the answer
OR gives 0, 1, 1, 1. Inverted, that is 1, 0, 0, 0 — the NOR gate you meet today.
Key Concept 14 min
1 · NAND — NOT AND
A NAND gate behaves like an AND gate followed by a NOT gate. Its symbol is the AND shape with the inverting circle on the output. The output is 1 unless both inputs are 1.
| Inputs | Working | Output | |
|---|---|---|---|
| A | B | P = A AND B | X = A NAND B |
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
2 · NOR — NOT OR
A NOR gate is an OR gate followed by NOT. The output is 1 only when neither input is 1.
3 · XOR — exclusive OR
An XOR gate outputs 1 when the inputs are different. It is like OR, but it excludes the case where both inputs are 1. Its symbol is the OR shape with a second curved line at the back.
4 · The three new gates, then all six side by side
NAND
Output is 0 only if both inputs are 1.
X = A NAND B
NOR
Output is 1 only if both inputs are 0.
X = A NOR B
XOR
Output is 1 if the inputs are different.
X = A XOR B
| A | B | NOT A | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 |

Worked Example 12 min
(a) Identify a gate from its truth table
A gate gives X = 1, 0, 0, 0 for the inputs 00, 01, 10, 11. Which gate is it?
- Row 00 gives 1. Only NAND and NOR output 1 when both inputs are 0.
- Row 01 gives 0. NAND would give 1 here; NOR gives 0.
- Check the last row: 11 gives 0, which matches NOR. Always confirm with a row you have not used yet.
- Answer: NOR.
(b) Show that a circuit behaves like an XOR gate
This circuit uses AND, OR and NOT gates. Show that it gives the same output as a single XOR gate.
- Add a column for each gate output, P and Q. Working columns stop you doing two gates in your head at once.
- P is 1 only in row 10, where A = 1 and B = 0. AND needs A = 1 and NOT B = 1.
- Q is 1 only in row 01. AND needs NOT A = 1 and B = 1.
- X = P OR Q gives 0, 1, 1, 0. OR is 1 when either working column is 1.
- That matches the XOR column row for row, so the circuit behaves as XOR. "Show" questions need the final comparison stated.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| A | B | P = A AND NOT B | Q = NOT A AND B | X = P OR Q | A XOR B |
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 |
Try It Yourself 12 min
Goal: Without looking, write the four-row truth tables for NAND, NOR and XOR. Check them against the reference sheet.
Goal: Identify the gate for each output column (inputs 00, 01, 10, 11): (a) 1, 1, 1, 0 (b) 0, 1, 1, 0 (c) 0, 1, 1, 1 (d) 1, 0, 0, 0.
Goal: Use truth tables to decide whether NOT (A AND B) gives the same output as (NOT A) AND (NOT B). Then find a version using OR that does match.
Hint
Work out both columns for all four rows. Compare row 01 first. Then try inverting each input and joining them with OR.
📝 Exam Practice 10 min
A gate has the truth table: 00 → 0, 01 → 1, 10 → 1, 11 → 0. State the single logic gate that produces this output.
Mark scheme
- XOR (1).
Complete the output column for a NAND gate and for a NOR gate.
| A | B | A NAND B | A NOR B |
|---|---|---|---|
| 0 | 0 | ||
| 0 | 1 | ||
| 1 | 0 | ||
| 1 | 1 |
Mark scheme
- NAND: 1, 1, 1, 0 (1).
- NOR: 1, 0, 0, 0 (1).
Draw the logic gate symbol for (a) a NOR gate and (b) an XOR gate.
Mark scheme
- (a) OR shape with an inverting circle on the output (1).
- (b) OR shape with an extra curved line across the inputs, no circle (1).
Explain the difference between the output of an OR gate and the output of an XOR gate.
Mark scheme
- Both give 1 when exactly one input is 1 (1).
- Both give 0 when both inputs are 0 (1).
- When both inputs are 1, OR gives 1 but XOR gives 0 (1).
Recap & Key Terms 3 min
NAND and NOR are AND and OR with the output inverted; the circle shows the inversion. XOR is 1 only when its inputs differ. To name a gate from a table, check rows 00, 11 and 01.
- NAND gate
- The output is 1 unless both inputs are 1 (NOT AND).
- NOR gate
- The output is 1 only if neither input is 1 (NOT OR).
- XOR gate
- The output is 1 if the two inputs are different; 0 if they are the same.
- Inverting circle
- The small circle on a gate's output meaning the output is inverted (NOT).
- Logic expression
- A gate or circuit written in words, e.g. X = A NAND B.
Homework 1 min
Task (≤ 15 min): A factory machine must stop (X = 1) unless both safety guards are closed (A = 1, B = 1). Name the single gate, draw its symbol and complete its truth table. Explain your choice in one sentence.
Model answer
- Gate: NAND.
- Outputs for AB = 00, 01, 10, 11: 1, 1, 1, 0.
- Reason: X is 0 only when both guards are closed, which is the NAND pattern.