Cambridge IGCSE · Topic 10 (3)
IGCSE Computer Science 0478 / Topic 10 / IGCSE

Gates, wired together.

A single gate cannot do much, but connect a few together and you can control an alarm, a greenhouse fan or a vending machine. Learn to turn a logic expression, a problem statement or a truth table into a correctly drawn circuit.

The key idea

A logic circuit joins gates so that the output of one gate becomes an input of the next. Work from the inputs on the left to the single output on the right. Every bracket in an expression is one gate whose output feeds the next gate. At IGCSE, NOT has one input and every other gate has exactly two inputs, so three inputs need two gates; circuits have at most three inputs and one output. Draw the circuit for the statement exactly as given, without simplifying it.

A B C X A AND B NOT C X = (A AND B) OR NOT C
Fig. 1: the circuit for X = (A AND B) OR NOT C, with the output of each gate labelled
Section 01

From an expression.

Choose an expression in the lab and watch it become a circuit. Click the inputs to see the 1s travel through each gate to the output.

Worked example Three gates
Draw the logic circuit for X = (A OR B) AND NOT C.
  1. Bracket first: an OR gate with inputs A and B.
  2. NOT C: a NOT gate with input C.
  3. The operator outside the brackets is AND: an AND gate whose two inputs are the output of the OR gate and the output of the NOT gate.
  4. The output of the AND gate is X.
Answer: OR gate (A, B) and NOT gate (C) both feed an AND gate, which gives X
Your turn
Which gates, and how many, are needed for X = NOT (A AND B) XOR C?
Examiner trap

Do not draw a three-input AND gate: at IGCSE every gate except NOT has exactly two inputs. To AND together A, B and C, use two gates: (A AND B) AND C.

Section 02

From a problem statement.

Pick a problem in the lab. Read it carefully, then reveal the expression, circuit and truth table one at a time to check your own.

Worked example Greenhouse fan
A greenhouse fan F switches on (F = 1) if the temperature is high (T = 1) and the window is closed (W = 0), or if the humidity is high (H = 1). Draw the circuit.
  1. The window must be closed, which is W = 0, so the circuit uses NOT W.
  2. "Temperature high and window closed" is one condition: T AND NOT W.
  3. "or if the humidity is high" joins H with OR: F = (T AND NOT W) OR H.
  4. Circuit: a NOT gate on W; an AND gate with inputs T and NOT W; an OR gate with inputs from the AND gate and H; the OR output is F.
Answer: F = (T AND NOT W) OR H, drawn with a NOT, an AND and an OR gate
Examiner trap

Do not simplify. If the statement says "(L and S) or (M and S)", draw two AND gates and an OR gate, even though a shorter circuit would give the same table.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

How is X = NOT (A OR B) drawn exactly as written?

Quick check+10 XP

Three inputs A, B and C must all be 1 for X to be 1. How is this drawn at IGCSE?

Quick check+10 XP

In the lab, the circuit for X = (A AND B) OR NOT C is shown. Which gate does input C go into first?

Quick check+10 XP

A light L is on (L = 1) when a switch S is on (S = 1) and it is not daytime (D = 0). Which expression matches?

Section 03

From a truth table.

Look at the rows where the output is 1. Each of those rows becomes an AND of its inputs (with NOT for every input that is 0), and the rows are joined with OR. First check whether the table matches a single gate.

ABX
000
011
101
110
Worked example Three inputs
A truth table for inputs A, B and C has X = 1 only in the row A = 1, B = 0, C = 1. Draw a circuit for it.
  1. The row needs A = 1, B = 0 and C = 1 all at once, so X = A AND NOT B AND C.
  2. Gates have only two inputs, so bracket it: X = (A AND NOT B) AND C.
  3. Circuit: a NOT gate on B; an AND gate with inputs A and NOT B; a second AND gate with that output and C.
Answer: X = (A AND NOT B) AND C
Your turn
A two-input truth table has X = 1, 0, 1, 1 for the rows 00, 01, 10, 11. Which two gates make it?
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

How many logic gates are needed to draw X = (A OR B) AND NOT C exactly as given?

Exam style+20 XP

A two-input truth table has the output column 0, 1, 1, 0 for the rows 00, 01, 10, 11. Which single gate gives this?

Exam style+20 XP

An alarm X sounds if a door is open (D = 1) and the system is set (S = 1), or if the panic button is pressed (P = 1). Which expression should be drawn?

Exam style+20 XP

Which statement about IGCSE logic circuits is correct?

Skill unlocked

Drawing logic circuits, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Drawing logic circuits from logic expressions, problem statements and truth tables.