← IGCSE Computer Science Paper 2

Completing a truth table from an expression: one gate

Complete the truth table row by row: apply the gate rule to the input values A and B in each row and write the result in column X. AND gives 1 only when both inputs are 1.

Understanding Completing a truth table from an expression: one gate in IGCSE Computer Science Paper 2

What it does: NOT reverses its single input, so the output column is the opposite of the A column in each row. AND needs both inputs to be 1, so only the last row (A = 1, B = 1) has X = 1. AND outputs 1 only when both A and B are 1. NOT reverses the input. A is 0, so X is 1. The inputs are different, so XOR outputs 1. Each row is worked out separately: take the input values in that row, apply the gate rule and write the result in X. XOR gives 1 when exactly one input is 1, so rows 00 and 11 give 0 and rows 01 and 10 give 1.

Common mistakes: AND gives 1 only when both inputs are 1. With A = 0 and B = 0 the output X must be 0, so the row should be 0 0 0. NOT reverses the input. When A = 1, X = NOT A is 0, so the row should be 1 0.

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 552–561) 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
X = A AND B. Row: A = 1, B = 0. What goes in column X?
X = 0X = 1
Matches
A = 1, B = 1 gives X = 0 for X = A AND B
↓
AND gives 1 when both inputs are 1, so this row should have X = 1, not 0
Applying
Meanings
Term
X = A AND B
Meaning
Complete the truth table row by row: apply the gate rule to the input values A and B in each row and write the result in column X. AND gives 1 only when both inputs are 1.
Practice
X = A AND B
Testing
Gaps
X = A B
Check Answer
Spots
1X = A AND B
20 0 1

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

The 'Oryx' badge — Desert Navigator, 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. X = A AND B. Row: A = 1, B = 0. What goes in column X?
A. X = 0 ✓
B. X = 1
AND gives 1 only when both inputs are 1. Here B is 0, so X is 0.
2. X = A AND B. Which row gives X = 1?
A. A = 1, B = 0
B. A = 1, B = 1 ✓
AND outputs 1 only when both A and B are 1.
3. X = NOT A. Row: A = 0. What goes in column X?
A. X = 1 ✓
B. X = 0
NOT reverses the input. A is 0, so X is 1.
4. To complete the truth table for X = NOT A, how many inputs do you apply the rule to in each row?
A. One input: A ✓
B. Two inputs: A and B
NOT has a single input, so each row only needs the value of A to be reversed.
5. X = A XOR B. Row: A = 1, B = 1. What goes in column X?
A. X = 1
B. X = 0 ✓
XOR gives 1 only when the inputs are different. Both are 1, so X is 0.

Match the Pairs

X = A AND B → In each row, write 1 in column X only when A and B are both 1; otherwise write 0
X = A XOR B → In each row, write 1 in column X only when A and B are different; write 0 when they are the same
For a one-input expression, flip the value of A in every row and write it in column X, so A = 0 gives X = 1 → X = NOT A
For the row where A = 1 and B = 1, this expression gives an output of 1 because both inputs are 1 → X = A AND B
A = 1, B = 1 gives X = 0 for X = A AND B → AND gives 1 when both inputs are 1, so this row should have X = 1, not 0
A = 1, B = 1 gives X = 1 for X = A XOR B → XOR gives 0 when both inputs are the same, so this row should have X = 0, not 1

Key Term

X = A AND B
Complete the truth table row by row: apply the gate rule to the input values A and B in each row and write the result in column X. AND gives 1 only when both inputs are 1.

Fill in the Blanks

1. X = A AND B
Hint: Type the gate name that outputs 1 only when both inputs are 1.
2. X = NOT A
Hint: Type the gate name that reverses a single input.
3. X = A XOR B
Hint: Type the gate name that outputs 1 when the inputs are different.
4. X = A AND B A = 1, B = 0 X = 0
Hint: Apply the AND rule to this row and type the output value.
5. X = A XOR B A = 1, B = 1 X = 0
Hint: Apply the XOR rule to a row where both inputs are the same and type the output.

Spot the Error

Question 1
A X = A AND B
B 0 0 1
C 0 1 0
D 1 1 1
Line B — AND gives 1 only when both inputs are 1. With A = 0 and B = 0 the output X must be 0, so the row should be 0 0 0.
Question 2
A X = NOT A
B A X
C 0 1
D 1 1
Line D — NOT reverses the input. When A = 1, X = NOT A is 0, so the row should be 1 0.
Question 3
A X = A XOR B
B A B X
C 0 1 0
D 1 1 0
Line C — XOR gives 1 when the inputs are different. A = 0 and B = 1 are different, so X should be 1 and the row should be 0 1 1.
Question 4
A X = A OR B
B 0 0 0
C 1 0 1
D 1 1 0
Line A — The row 1 1 0 shows the output is 0 when both inputs are 1. That is XOR behaviour, so the expression should be X = A XOR B.
Question 5
A X = A XOR B
B 0 0 1
C 0 1 1
D 1 0 1
E 1 1 0
Line B — XOR gives 0 when both inputs are the same. With A = 0 and B = 0, X should be 0, so the row should be 0 0 0.

Student with a class code? Join your class →