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.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
NANDFill in the Blanks
Spot the Error
Student with a class code? Join your class →