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.
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.
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.