← IGCSE Computer Science Paper 2

Creating a logic circuit from a problem statement

Turn the problem statement into a logic expression first, then draw one gate for each operator to build the circuit. Use inputs A, B, C (up to three) and one output X. Do not simplify.

Understanding Creating a logic circuit from a problem statement in IGCSE Computer Science Paper 2

What it does: 'Both on' means AND, 'or' means OR. The statement becomes this expression, which is then drawn as an AND gate feeding an OR gate. 'A and B both on' is grouped in brackets and joined to 'or C' with OR. Writing the expression first makes the circuit easy to draw. Draw one gate for each operator in the expression. There are two operators, AND and OR, so there are two gates. Inputs are not gates. The bracket (A AND B) is worked out by the AND gate first. Its output is then one of the two inputs to the OR gate, and C is the other.

Common mistakes: The statement says A and B must both be on, so the expression uses AND. The gate drawn must be an AND gate, not an OR gate. The statement says A or C, so the expression must use OR. It should be X = A OR C.

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
Problem statement: an alarm X sounds when switch A and switch B are both on, or when switch C is on. Which expression matches?
X = (A AND B) OR CX = A AND (B OR C)
Matches
Drawing the gates first, then writing X = A AND B OR C afterwards from the picture
↓
The steps are in the wrong order and the brackets are missing. The expression must be written first from the problem statement, and the circuit drawn from it.
Applying
Meanings
Term
X = (A AND B) OR C
Meaning
Turn the problem statement into a logic expression first, then draw one gate for each operator to build the circuit. Use inputs A, B, C (up to three) and one output X. Do not simplify.
Practice
Statement: A or B is on, but C is off
Testing
Gaps
X = (A AND B) C
Check Answer
Spots
2Expression: X = A AND B
3Draw: OR gate, inputs A, B

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

The 'Barreleye Fish' badge — Clear Vision, 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. Problem statement: an alarm X sounds when switch A and switch B are both on, or when switch C is on. Which expression matches?
A. X = A AND (B OR C)
B. X = (A AND B) OR C ✓
'A and B both on' is grouped in brackets and joined to 'or C' with OR. Writing the expression first makes the circuit easy to draw.
2. What is the FIRST step when drawing a circuit from a problem statement?
A. Write the logic expression ✓
B. Draw gates straight away and guess the wiring
The route is statement, then expression, then circuit. The expression tells you exactly which gates to draw and how to join them.
3. How many gates are needed to draw X = (A AND B) OR C?
A. 2 gates: one AND and one OR ✓
B. 3 gates: one for each input A, B and C
Draw one gate for each operator in the expression. There are two operators, AND and OR, so there are two gates. Inputs are not gates.
4. In the circuit for X = (A AND B) OR C, what goes into the OR gate?
A. Inputs A and B directly, plus input C
B. The output of the AND gate and input C ✓
The bracket (A AND B) is worked out by the AND gate first. Its output is then one of the two inputs to the OR gate, and C is the other.
5. Should you simplify the expression before drawing the circuit?
A. No, draw exactly what the expression says ✓
B. Yes, always simplify it first
The circuit must match the expression you wrote from the statement. Do not simplify it.

Match the Pairs

X = (A AND B) OR C → Draw an AND gate for A and B, then feed its output and C into an OR gate whose output is X
X = NOT (A OR B) AND C → Draw an OR gate for A and B, put a NOT gate on its output, then feed that and C into an AND gate whose output is X
Problem statement: 'The alarm X sounds when switch A and switch B are both on, or when sensor C is on.' Write the expression first. → X = (A AND B) OR C
Problem statement: 'The motor X runs when sensor A is on and sensor B is not on.' Write the expression first. → X = A AND (NOT B)
Drawing the gates first, then writing X = A AND B OR C afterwards from the picture → The steps are in the wrong order and the brackets are missing. The expression must be written first from the problem statement, and the circuit drawn from it.
X = A OR B simplified from X = (A AND B) OR (A AND NOT B) → The expression has been simplified before drawing. The circuit must be drawn from the expression as written, without simplification.

Key Term

X = (A AND B) OR C
Turn the problem statement into a logic expression first, then draw one gate for each operator to build the circuit. Use inputs A, B, C (up to three) and one output X. Do not simplify.

Fill in the Blanks

1. Statement: X is 1 if A and B are 1, or C is 1 X = (A AND B) OR C
Hint: Type the gate word that joins the bracket to input C.
2. Motor X runs when A and B are both 1 X = A AND B
Hint: Type the label used for the single output of the circuit.
3. Alarm X is on if A is on and B is off X = A AND NOT B
Hint: Type the gate word that matches 'is off' for input B.
4. Step 1: write the logic expression Step 2: draw one gate per operator
Hint: Type what you must write from the problem statement before drawing any gates.
5. X = (A AND B) OR (A AND C) Gates to draw without simplifying: 3
Hint: Type how many gates are needed: one for each operator, with no simplifying.

Spot the Error

Question 1
A Statement: A and B both on
B Expression: X = A AND B
C Draw: OR gate, inputs A, B
D Output of gate is labelled X
Line C — The statement says A and B must both be on, so the expression uses AND. The gate drawn must be an AND gate, not an OR gate.
Question 2
A Statement: A or C is on
B Expression: X = A AND C
C Draw: OR gate, inputs A, C
D Output is labelled X
Line B — The statement says A or C, so the expression must use OR. It should be X = A OR C.
Question 3
A Statement: X on if A is off
B Expression: X = NOT A
C Draw: NOT gate, inputs A, B
Line C — A NOT gate has exactly one input, and the statement only mentions A. It should be: NOT gate, input A.
Question 4
A Statement: A and B, or C
B Expression: X = (A AND B) OR C
C Gate 1: AND, inputs A and B
D Gate 2: OR, inputs A and C
E Output of gate 2 is X
Line D — The OR gate must take the output of gate 1 (A AND B) as one input, not A on its own. It should be inputs G1 and C.
Question 5
A Step 1: draw the gates first
B Step 2: gate for each operator
C Step 3: label inputs A, B, C
D Step 4: label the output X
Line A — The logic expression must be written first. The gates are then drawn from that expression, one for each operator.

Student with a class code? Join your class →