What are NAND, NOR and XOR gates?
Each accepts two binary inputs and produces one binary output. NAND and NOR invert the output of AND and OR respectively. XOR checks whether the inputs are different.
Cambridge syllabus focus
Sections 10.5, 10.6 and 10.7. The foundational NOT, AND and OR operations are covered in Blog 1 (link activates after publication).
10.5 — How does NAND work?
NAND gives 0 only when both inputs are 1. Its AND-shaped symbol has a small output inversion circle.
| A | B | NAND |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Check your understanding
Calculate 1 NAND 1.
Reveal answer
0 — AND is 1, then invert.
10.6 — How does NOR work?
NOR gives 1 only when both inputs are 0. Its OR-shaped symbol has a small output inversion circle.
| A | B | NOR |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Check your understanding
Calculate 0 NOR 0.
Reveal answer
1 — OR is 0, then invert.
10.7 — How does XOR work?
XOR gives 1 when exactly one input is 1. Its symbol resembles OR but has an extra curved line on the input side, not an inversion circle.
| A | B | XOR |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Check your understanding
Calculate 1 XOR 1.
Reveal answer
0 — the inputs are equal.
Compare the three gates
Compare NAND, NOR and XOR against AND and OR for the same input combinations.
| A | B | AND | NAND | OR | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 | 1 | 0 | 0 |
Worked example 1 — NAND then XOR
For X = (A NAND B) XOR C, first calculate P = A NAND B. Then XOR P with C. Three inputs require eight rows.
| A | B | C | P = A NAND B | X = P XOR C |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 |
For A = 1, B = 1 and C = 0, P = 0 and X = 0.
Worked example 2 — NOR then NAND
For X = (A NOR B) NAND C, first calculate Q = A NOR B, then NAND Q with C.
| A | B | C | Q = A NOR B | X = Q NAND C |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 | 1 |
Examiner insights — February/March 2026
The Cambridge February/March 2026 Paper 2 Principal Examiner Report notes that most candidates drew good logic circuits and completed truth tables accurately in Question 7. Some candidates drew NOR and XOR symbols imprecisely, while a small number gave inverted outputs, possibly from an added or missed NOT.
FutureLogic advice: distinguish the output inversion circle from XOR's extra input-side curve, and calculate intermediate outputs. These observations apply to that exam series only.
Common exam mistakes
1 XOR 1 = 0, but 1 OR 1 = 1.
For NAND and NOR, compute AND or OR first, then reverse.
NOR has an output circle; XOR has an extra input-side curve.
Calculate each gate separately in a multi-gate circuit.
Original FutureLogic exam-style practice
Original questions, not official Cambridge examination questions. Suggested marks are indicative.
Question 1 (2 marks)
Explain how NAND differs from AND.
Reveal model answer
NAND inverts AND (1); it outputs 0 only when both inputs are 1 (1).
Question 2 (2 marks)
State and explain 0 NOR 0.
Reveal model answer
1 (1), because OR gives 0 and NOR reverses it (1).
Question 3 (4 marks)
Construct the four-row truth table for A XOR B.
Reveal model answer
For 00, 01, 10, 11 the outputs are 0, 1, 1, 0.
Question 4 (4 marks)
Complete a truth table for (A NAND B) XOR C with an intermediate column.
Reveal model answer
For 000, 001, 010, 011, 100, 101, 110, 111 the outputs are 1, 0, 1, 0, 1, 0, 0, 1.
Quick quiz
- Which gate is AND followed by NOT?
- When is NOR equal to 1?
- When is XOR equal to 1?
- What is 1 XOR 1?
- What distinguishes the XOR symbol?
Quiz answers
Reveal all answers
- NAND.
- Both inputs are 0.
- Inputs differ.
- 0.
- An extra curved line on the input side.
Final summary
NAND
NOT AND; 0 only for 11.
NOR
NOT OR; 1 only for 00.
XOR
1 only for 01 and 10.
Exam method
Accurate symbols; intermediate columns.