← IGCSE Computer Science Paper 2

The NAND gate

A gate with two inputs that outputs 0 only when both inputs are 1. It is the opposite of AND (AND followed by NOT). Its truth table output is 1 1 1 0. Written X = A NAND B.

Understanding The NAND gate in IGCSE Computer Science Paper 2

What it does: NAND gives 0 only on the row where both inputs are 1, so its output column is 1 1 1 0, the opposite of AND (0 0 0 1). A small circle on the output means NOT. AND with that circle is NAND. OR with that circle is NOR. The gate name goes between the two inputs, in the same way as X = A AND B. Work out A AND B first, then invert the result. This is why NAND means NOT AND. A AND B gives 0, and NOT turns that into 1. NAND outputs 1 whenever at least one input is 0.

Common mistakes: The expression is for a NAND gate, so line 1 must be X = A NAND B. NOR is a different gate, and it does not match the truth table rows below. A NAND gate has two inputs, A and B, not one. Only the NOT gate has a single input. It should read: NAND gate: 2 inputs, A and B.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 539–551) and word search (Modules 539–580).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which output column is correct for a NAND gate with inputs 00, 01, 10, 11 (in that order)?
1 1 1 00 0 0 1
Matches
A NAND B gives 0 0 0 1
↓
0 0 0 1 is the AND output column. NAND is the opposite of AND, so its output column is 1 1 1 0.
Applying
Meanings
Term
NAND
Meaning
A gate with two inputs that outputs 0 only when both inputs are 1. It is the opposite of AND (AND followed by NOT). Its truth table output is 1 1 1 0. Written X = A NAND B.
Practice
X = A NAND B
Testing
Gaps
X = A B
Check Answer
Spots
1X = A NOR B
2A=0 B=0 -> X=1

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Hyena' badge — Savannah Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which output column is correct for a NAND gate with inputs 00, 01, 10, 11 (in that order)?
A. 1 1 1 0 ✓
B. 0 0 0 1
NAND is the opposite of AND. AND gives 0 0 0 1, so NAND gives 1 1 1 0.
2. When does a NAND gate output 0?
A. When either input is 1
B. Only when both inputs are 1 ✓
NAND outputs 0 only on the row A = 1, B = 1. In every other row the output is 1.
3. Which symbol shows a NAND gate?
A. The AND symbol with a small circle on the output ✓
B. The OR symbol with a small circle on the output
A small circle on the output means NOT. AND with that circle is NAND. OR with that circle is NOR.
4. Which is the correct logic expression for a NAND gate?
A. X = NAND A AND B
B. X = A NAND B ✓
The gate name goes between the two inputs, in the same way as X = A AND B.
5. A NAND gate is the same as which combination of gates?
A. An AND gate followed by a NOT gate ✓
B. A NOT gate followed by an OR gate
Work out A AND B first, then invert the result. This is why NAND means NOT AND.

Match the Pairs

X = A NAND B → The output X is 0 only when both A and B are 1; in every other case X is 1.
X = NOT (A AND B) → NAND written as AND followed by NOT: the AND result is inverted.
The NAND gate output column for inputs 00, 01, 10 and 11 reads 1 1 1 0 → A=0,B=0 -> 1 | A=0,B=1 -> 1 | A=1,B=0 -> 1 | A=1,B=1 -> 0
NAND is the opposite of AND: it gives 1 whenever AND gives 0 and 0 whenever AND gives 1 → A=1, B=1: AND gives 1, NAND gives 0
A NAND B gives 0 0 0 1 → 0 0 0 1 is the AND output column. NAND is the opposite of AND, so its output column is 1 1 1 0.
X = A NAND B NAND C (a NAND gate with 3 inputs) → A NAND gate has exactly two inputs, so it cannot join three inputs A, B and C in a single gate.

Key Term

NAND
A gate with two inputs that outputs 0 only when both inputs are 1. It is the opposite of AND (AND followed by NOT). Its truth table output is 1 1 1 0. Written X = A NAND B.

Fill in the Blanks

1. X = A NAND B
Hint: Type the gate name for a two-input gate whose output is 0 only when both inputs are 1.
2. X = NOT (A AND B)
Hint: Type the gate inside the brackets that NAND is built from before NOT is applied.
3. NAND output column: 1 1 1 0
Hint: Type the output in the last row, where both inputs are 1.
4. X = NOT (A AND B)
Hint: Type the gate applied to the AND result to make a NAND.
5. NAND = AND symbol + small circle on output
Hint: Type the small shape added to the output of the AND symbol.

Spot the Error

Question 1
A X = A NOR B
B A=0 B=0 -> X=1
C A=0 B=1 -> X=1
D A=1 B=0 -> X=1
E A=1 B=1 -> X=0
Line A — The expression is for a NAND gate, so line 1 must be X = A NAND B. NOR is a different gate, and it does not match the truth table rows below.
Question 2
A NAND gate: 1 input, A and B
B Output X is 0 only if
C A and B are both 1
Line A — A NAND gate has two inputs, A and B, not one. Only the NOT gate has a single input. It should read: NAND gate: 2 inputs, A and B.
Question 3
A A B X
B 1 1 1
C 0 1 1
D 1 0 1
E 0 0 1
Line B — A NAND gate outputs 0 only when both inputs are 1. When A=1 and B=1 the output is 0, so the row should be 1 1 0.
Question 4
A A ← 1
B B ← 1
C T ← A AND B
D X ← T
Line D — NAND is AND followed by NOT. Line 4 must invert the AND result: X ← NOT T. Without NOT the program is just an AND gate.
Question 5
A Expression for NAND:
B X = NOT A AND B
C Output when A=1, B=1 is 0
Line B — Without brackets, NOT applies only to A. NAND inverts the whole AND result, so the brackets are needed: X = NOT (A AND B).

Student with a class code? Join your class →