Boolean Logic and Logic Gates: Computer Science 0478 (Cambridge O Level / IGCSE)
Syllabus 10.1, 10.2, 10.3 · Strand 10 Boolean logic
- Questions
- 10
- Total marks
- 43
- Tier mix
- 10 Core
0 of 10 questions completed
Syllabus coverage
- 10.1 10 questions completed
- 10.2 10 questions completed
- 10.3 10 questions completed
Every decision a computer makes ultimately reduces to combinations of true and false, and this topic covers the six logic gates the syllabus requires you to recognise by their standard symbols and to use correctly: NOT, AND, OR, NAND, NOR and XOR (also written EOR). NOT is the only gate with a single input, inverting it, while every other gate here takes exactly two inputs and produces one output according to a fixed rule, for example AND outputs true only when both inputs are true, and XOR outputs true only when its inputs differ (10.1, 10.2).
The practical skill is moving fluently between three representations of the same logic: a written problem statement, a logic expression, a drawn circuit of connected gates, and a truth table listing every combination of inputs against the resulting output. Given any one of these, you should be able to produce the other two without simplifying the circuit, and questions are limited to a maximum of three inputs and a single output, so a truth table never needs more than eight rows (10.3).
The exam-style questions below are original, written to match this syllabus objective, and each is followed by a full worked solution so you can check your method step by step.
Question 1
A technician is testing an unlabelled two-input logic gate taken from a circuit board. She sets every possible combination of inputs A and B and records the output each time.
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Which single logic gate produces this truth table?
Question 2
A workshop uses a benchtop 3D printer fitted with a safety enclosure. To protect the print head, the printer's control board only sends the start-print signal G when both of the following are true at the same time:
- the enclosure door sensor confirms the door is closed (input D = 1 if the door is closed, 0 if it is open)
- the filament sensor confirms filament is loaded in the feed tube (input F = 1 if filament is present, 0 if the feed tube is empty)
(a) State the name of the single logic gate that combines inputs D and F to produce this behaviour. [1]
(b) Complete the truth table for the start-print signal G. [2]
| D | F | G |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
(c) A technician closes the enclosure door but does not notice that the filament spool has run out, leaving the feed tube empty. Using your completed truth table, explain whether the printer starts the print job, and state what the technician should do instead. [2]
Question 3
An escape-room designer builds a puzzle box with three physical switches labelled P, Q and R, each of which can be set up (1) or down (0). Inside the box, the switches are wired to two gates:
- Gate 1 is a NAND gate, with inputs P and Q.
- Gate 2 is a XOR gate. One of its inputs is the output of Gate 1, and its other input is switch R.
The output of Gate 2, labelled Z, lights a green LED whenever Z = 1.
(a) Write the logic expression for Z in terms of P, Q and R. [2]
(b) Complete the truth table for Z, showing all eight combinations of P, Q and R. [4]
| P | Q | R | Z |
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
(c) State the number of the eight switch combinations for which the green LED lights. [1]
Question 4
At the GameOn Arena esports tournament, a check-in kiosk decides whether to unlock a turnstile using output Access, based on three inputs:
- Q = 1 when the player's QR-code ticket scans as valid, 0 otherwise
- D = 1 when the kiosk's camera confirms the player's face matches their photo ID, 0 otherwise
- K = 1 when a staff member inserts a physical override key, 0 otherwise
The turnstile unlocks according to the logic expression: Access = (Q AND D) OR K
(a) State the name of the single logic gate that combines Q and D, before the result is combined with K. [1]
(b) Complete the truth table for Access, showing all eight combinations of Q, D and K. [4]
| Q | D | K | Access |
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
(c) A tournament organiser says the override key should only ever act as a backup, and must never by itself be the sole reason a player is let in. Using your completed truth table, explain whether the current design meets this requirement. [2]
Question 5
A student is simplifying a section of a circuit diagram and finds that this section always produces the same output as the logic expression NOT (A AND B), for every combination of inputs A and B.
Which single logic gate could replace this entire section of the circuit?
Question 6
GreenGro Robotics builds an automated drip-irrigation controller for a single planter box. The controller has one soil-moisture sensor input, M, where M = 1 means the soil is currently wet and M = 0 means the soil is currently dry. The controller's pump-enable output, P, must switch to 1 (turn the pump on) exactly when the soil is not wet, and must be 0 (keep the pump off) whenever the soil is wet.
Which single logic gate, applied to input M, produces this behaviour for P?
Question 7
SecureHome fits a two-sensor alarm to a garden shed. A window-vibration sensor produces input W (W = 1 if vibration is detected on the window, 0 otherwise). A door-contact sensor produces input D (D = 1 if the door contact is broken, 0 otherwise). The alarm sounds and output signal A = 1 if either sensor is triggered, or both are triggered together, and A = 0 only when neither sensor is triggered.
(a) State the name of the single logic gate that combines inputs W and D to produce this behaviour. [1]
(b) Complete the truth table for the alarm output A. [2]
| W | D | A |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
(c) One night, a sheet of cardboard leaning against the inside of the shed accidentally covers the window sensor, so it can never report vibration and is stuck permanently at W = 0. Later that night someone forces the shed door open, so D = 1. Using your completed truth table, explain whether the alarm still sounds in this situation. [2]
Question 8
PixelPlay Labs tests game controllers on a production line. Each controller has two analogue joystick modules that are calibrated separately: the left-stick calibration test produces input L (L = 1 if the left stick passes, 0 if it fails), and the right-stick calibration test produces input R (R = 1 if the right stick passes, 0 if it fails). A mismatch-warning LED, output M, must light (M = 1) only when the two calibration results disagree with each other, meaning one stick passes while the other fails, and must stay off (M = 0) whenever the two results agree, whether both pass or both fail.
Which single logic gate, combining inputs L and R, produces this behaviour for M?
Question 9
A warehouse extractor-fan controller has three inputs: H = 1 if a humidity sensor reads above the trigger threshold, otherwise 0; C = 1 if the air-conditioning unit is currently running, otherwise 0; and L = 1 if a staff member has pulled the manual override lever, otherwise 0. Inside the controller, the signals pass through three gates in sequence:
- Gate 1 is a NOT gate, with input C.
- Gate 2 is an AND gate, with inputs H and the output of Gate 1.
- Gate 3 is an OR gate, with inputs L and the output of Gate 2.
The output of Gate 3, labelled Vent, switches the extractor fan on whenever Vent = 1.
(a) State the logic expression for Vent in terms of H, C and L, and name the three gates in the order the signals pass through them. [2]
(b) Complete the truth table for Vent, showing all eight combinations of H, C and L. [4]
| H | C | L | Vent |
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
(c) State whether the fan runs (Vent = 1) in the specific case where the humidity sensor reads high, the air-conditioning unit is already running, and the lever has not been pulled, and explain your answer using the truth table. [2]
Question 10
A campus print-station kiosk automatically issues refunds for failed print jobs. Three inputs feed the refund-decision circuit: J = 1 if a printer-jam sensor detects that the job jammed partway through, otherwise 0; E = 1 if the user's account shows an error code was logged for that job, otherwise 0; and S = 1 if the self-service refund terminal is currently enabled at that kiosk, otherwise 0. A technician built the circuit from exactly two logic gates, but the paperwork recording which gates, and in what order, has been lost. All that survives is the completed truth table for the refund output, Rfund, shown below.
| J | E | S | Rfund |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
(a) By comparing each pair of rows that share the same values of J and E but differ in S, determine what role S plays in the circuit, and state whether Rfund can ever equal 1 when S = 0. [2]
(b) State the logic expression for Rfund in terms of J, E and S, and name the two gates used and the order in which they are applied. [3]
(c) State the number of the eight (J, E, S) combinations for which the refund is issued automatically (Rfund = 1), and identify them. [2]