← IGCSE Computer Science Paper 2

Creating a logic circuit from a truth table

To draw a circuit from a truth table, write the expression that gives the X output column, then draw one gate for each operator in it. Do not simplify the expression.

Understanding Creating a logic circuit from a truth table in IGCSE Computer Science Paper 2

What it does: An output column of 0, 1, 1, 1 matches OR, so the whole circuit is one OR gate. The AND part covers the rows where A and B are both 1, and the OR joins it to C. Draw one gate per operator. Write the expression for the X column first. Here only A = 1 and B = 1 gives X = 1, so the expression is X = A AND B. Then draw an AND gate. NOR gives 1 only when both inputs are 0. NAND gives 1, 1, 1, 0 for the same rows, so it does not match.

Common mistakes: The expression X = A AND B gives 1 only when both inputs are 1. The row 0 1 must therefore give X = 0, so the line should be '0 1 | 0'. Without brackets, NOT applies only to A. The NOT must apply to the result of A OR B, so the line should be 'X = NOT (A OR 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 562–580) 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
A truth table for inputs A and B has X = 0, 0, 0, 1 for rows 00, 01, 10, 11. What is the first step to draw the circuit?
Write the expression X = A AND BDraw an OR gate and test it
Matches
Table: X = 1 only when A = 1 and B = 1. Expression written: X = A OR B
↓
OR would also give 1 when only one input is 1, but the table has a 1 only on the row where both are 1. The expression should be X = A AND B.
Applying
Meanings
Term
X = (A AND B) OR C
Meaning
To draw a circuit from a truth table, write the expression that gives the X output column, then draw one gate for each operator in it. Do not simplify the expression.
Practice
X = (A AND B) OR C
Testing
Gaps
X = A B
Check Answer
Spots
20 0 | 0
30 1 | 1

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

The 'Jellyfish' badge — Flow Controller, 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. A truth table for inputs A and B has X = 0, 0, 0, 1 for rows 00, 01, 10, 11. What is the first step to draw the circuit?
A. Write the expression X = A AND B ✓
B. Draw an OR gate and test it
Write the expression for the X column first. Here only A = 1 and B = 1 gives X = 1, so the expression is X = A AND B. Then draw an AND gate.
2. A table with inputs A and B has X = 1, 0, 0, 0 for rows 00, 01, 10, 11. Which expression gives this X column?
A. X = A NOR B ✓
B. X = A NAND B
NOR gives 1 only when both inputs are 0. NAND gives 1, 1, 1, 0 for the same rows, so it does not match.
3. A table with inputs A and B has X = 0, 1, 1, 0 for rows 00, 01, 10, 11. Which expression do you write?
A. X = A XOR B ✓
B. X = A OR B
The output is 1 when the inputs are different, but 0 when both are 1. That is XOR. OR would give 1 in the last row.
4. A table has X = 1, 1, 1, 0 for rows 00, 01, 10, 11. Which circuit do you draw from the expression X = NOT (A AND B)?
A. A NOT gate on A and a NOT gate on B, then an AND gate
B. An AND gate whose output goes into a NOT gate ✓
Draw one gate for each operator in the expression. The brackets mean AND happens first, then its output goes into NOT.
5. The expression for a table is X = (A AND B) OR C. How many gates do you draw?
A. 3 gates: one for each input A, B and C
B. 2 gates: one AND and one OR ✓
Count the operators, not the inputs. There is one AND and one OR, so two gates. A and B feed the AND, and its output and C feed the OR.

Match the Pairs

X = NOT A → The expression for a table where X is always the opposite of A. Draw one NOT gate.
X = (A OR B) AND C → Draw an OR gate for A and B, then feed its output and input C into an AND gate. That is two gates, one per operator.
Single-gate table: X is 1 when at least one of A and B is 1, so the expression needs just one OR gate. → X = A OR B
Three-input table: X is 1 when A and B are both 1, or when C is 1. Write both parts, join them and do not simplify. → X = (A AND B) OR C
Table: X = 1 only when A = 1 and B = 1. Expression written: X = A OR B → OR would also give 1 when only one input is 1, but the table has a 1 only on the row where both are 1. The expression should be X = A AND B.
Circuit for X = (A AND B) OR C drawn with a single AND gate → Only one gate was drawn. The expression has two operators, so the circuit needs an AND gate and an OR gate, with the AND output going into the OR gate along with C.

Key Term

X = (A AND B) OR C
To draw a circuit from a truth table, write the expression that gives the X output column, then draw one gate for each operator in it. Do not simplify the expression.

Fill in the Blanks

1. X = A AND B
Hint: The table has X as 1 only on the row where both inputs are 1. Type the operator for that gate.
2. X = NOT A
Hint: The table has one input, and X is always the opposite of A. Type the gate name that gives this.
3. X = (A AND B) OR C
Hint: X is 1 when A and B are both 1, or when C is 1 on its own. Type the operator that joins the bracket to C.
4. X = (A OR B) AND C
Hint: X is 1 only when C is 1 and at least one of A or B is 1. Type the operator that joins the bracket to C.
5. X = (A AND B) OR C Gates to draw: 2
Hint: Draw one gate for each operator in the unsimplified expression. Type how many gates this circuit needs.

Spot the Error

Question 1
A A B | X
B 0 0 | 0
C 0 1 | 1
D 1 0 | 0
E 1 1 | 1
F X = A AND B
Line C — The expression X = A AND B gives 1 only when both inputs are 1. The row 0 1 must therefore give X = 0, so the line should be '0 1 | 0'.
Question 2
A A B | X
B 0 0 | 1
C other rows | 0
D X = NOT A OR B
E Gates: one OR, then one NOT
Line D — Without brackets, NOT applies only to A. The NOT must apply to the result of A OR B, so the line should be 'X = NOT (A OR B)'.
Question 3
A X = A AND (B OR C)
B Gate 1: A AND B
C Gate 2: result OR C
D Row A=0,B=0,C=1 gives X=1
Line A — The expression must match the gates described: A AND B first, then OR C. The brackets belong round A AND B. The broken version gives X = 0 for the row 0 0 1, but the table says X = 1. It should be 'X = (A AND B) OR C'.
Question 4
A A B C | X
B 1 1 0 | 1
C 0 0 1 | 0
D X = (A AND B) OR C
E Draw an AND gate, then an OR gate
Line C — The expression has OR C, so whenever C = 1 the output X must be 1. The row 0 0 1 must give X = 1, so the line should be '0 0 1 | 1'.
Question 5
A 1 Simplify the expression
B 2 Draw one gate per operator
C 3 Do not simplify it
D 4 Check against the table
Line A — The first step is to write the expression that gives the X column, not to simplify it. Step 3 says not to simplify, so the line should be '1 Write the expression for X'.

Student with a class code? Join your class →