Syllabus & Goals 3 min
Cambridge 10.1 · Circuits, expressions and truth tables from a problem Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Turn a written problem and its parameter table into a logic expression.
- Draw the logic circuit for the problem using two-input gates.
- Complete the truth table and use it to check the circuit.
Textbook: Chapter 10, §10.3 Examples 6 and 7, Activity 10.4 and exam-style questions (pp. 371–377, 382–386)
Recap / Warm-Up 5 min
You can now move between circuits, expressions and truth tables in every direction. Today's starting point is plain English.
Quick starter
In a parameter table, P = 1 means "pressure ≤ 5 bar". How do you write "pressure > 5 bar"?
Reveal the answer
NOT P. The 1 here is the low-pressure case, so high pressure is P = 0.
Key Concept 14 min
1 · The route from words to a circuit
Exam problems describe a safety or control system. Sensors give the inputs; a logic circuit decides the output, such as sounding an alarm or shutting a machine down. A parameter table tells you what 1 and 0 mean for each input.
2 · Keywords become gates
| Words in the problem | Logic |
|---|---|
| "either … or …", "or" between whole conditions | OR joining the terms |
| "and" inside one condition | AND |
| a condition that matches binary value 0 | NOT on that input |
| "neither … nor …" | NOR (or NOT of an OR) |

Worked Example 12 min
(a) An automatic greenhouse vent
| Parameter | Input | 1 means | 0 means |
|---|---|---|---|
| temperature | T | > 28 °C | ≤ 28 °C |
| rain sensor | R | raining | not raining |
| humidity | H | > 80 % | ≤ 80 % |
- Split the statement at "or": two conditions. Each becomes one bracket.
- "temperature above 28 °C and not raining" → (T AND NOT R). Not raining is R = 0, so NOT R.
- "humidity above 80 % and not raining" → (H AND NOT R).
- Join with OR. Either condition opens the vent.
- Draw it. One NOT gate on R can feed both AND gates through a junction. Sharing is allowed and keeps the circuit small.
X = (T AND NOT R) OR (H AND NOT R)
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| T | R | H | T AND NOT R | H AND NOT R | X |
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 |
Check: in every row where R = 1 (raining), X = 0. That matches the problem, so the circuit is right.
(b) A lift safety system with three conditions
| Parameter | Input | 1 means | 0 means |
|---|---|---|---|
| load | L | > 600 kg | ≤ 600 kg |
| door | D | closed | open |
| speed | S | > 2 m/s | ≤ 2 m/s |
- (i) load over 600 kg and door closed → (L AND D).
- (ii) door open and speed over 2 m/s → (NOT D AND S). Door open is D = 0.
- (iii) load 600 kg or less and speed over 2 m/s → (NOT L AND S). ≤ 600 kg is L = 0.
- Join all three with OR. With two-input gates, (i) OR (ii) gives (iv), then (iv) OR (iii) gives X. Three terms need two OR gates.
- Build the truth table from the expression, then trace one row through the circuit to check. Two independent methods agreeing is strong evidence.
X = (L AND D) OR (NOT D AND S) OR (NOT L AND S)
| Inputs | Working | Output | |||||
|---|---|---|---|---|---|---|---|
| L | D | S | (i) L AND D | (ii) NOT D AND S | (iii) NOT L AND S | (iv) = (i) OR (ii) | X = (iv) OR (iii) |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 |
Try It Yourself 12 min
Goal: A car alarm (X) sounds if the car is locked (K = 1) and a door is opened (D = 1). Write the logic expression and draw the circuit.
Goal: A school bell (X) rings if it is a school day (S = 1) and the clock reads the end of a lesson (E = 1), or if the fire button is pressed (F = 1). Write the expression, draw the circuit and complete the truth table.
Goal: A cooling fan (X) switches on if: the temperature is not below 30 °C and the room is occupied; or the humidity is high and the window is closed. Inputs: C = 1 means temperature below 30 °C; O = 1 means occupied; W = 1 means window open; H = 1 means humidity high. Write the expression and draw the circuit with two-input gates.
Hint
Two inputs are "inverted": "not below 30 °C" is NOT C, and "window closed" is NOT W. This circuit has four inputs, so its truth table would need 16 rows — you do not need to write it.
📝 Exam Practice 10 min
| Parameter | Input | Binary value | Condition |
|---|---|---|---|
| water level | L | 1 | level < 2 m |
| 0 | level ≥ 2 m | ||
| temperature | T | 1 | > 60 °C |
| 0 | ≤ 60 °C | ||
| inlet valve | V | 1 | closed |
| 0 | open |
Write a logic expression for the alarm system.
Mark scheme
- (L AND T) (1)
- OR (NOT L AND V) (1).
Draw a logic circuit for the alarm system. Each gate must have a maximum of two inputs.
Mark scheme
- AND gate with inputs L and T (1).
- NOT gate on L (1).
- AND gate with inputs NOT L and V (1).
- OR gate joining both AND outputs to give X (1).
Complete the truth table for the alarm system.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| L | T | V | Working space | X | |
| 0 | 0 | 0 | |||
| 0 | 0 | 1 | |||
| 0 | 1 | 0 | |||
| 0 | 1 | 1 | |||
| 1 | 0 | 0 | |||
| 1 | 0 | 1 | |||
| 1 | 1 | 0 | |||
| 1 | 1 | 1 | |||
Mark scheme
- 8 correct = 4; 6–7 = 3; 4–5 = 2; 2–3 = 1.
- X (000 → 111): 0, 1, 0, 1, 0, 0, 1, 1.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| L | T | V | L AND T | NOT L AND V | X |
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
A student wrote X = (L AND T) OR (L AND V). Explain the error.
Mark scheme
- The second condition is water level 2 m or more, which is L = 0 (1)…
- …so the second term needs NOT L: (NOT L AND V) (1).
Recap & Key Terms 3 min
Read the parameter table first, split the statement at each "or", write each condition as an AND term with NOT wherever the condition is the 0 case, and join with OR. Draw the circuit, then check it against the truth table.
- Problem statement
- A written description of when a system's output should be 1.
- Parameter table
- A table giving each input's letter and the condition that 1 and 0 represent.
- Condition
- One situation in the statement, written as a single AND term.
- Logic circuit
- Gates combined to carry out a task, such as a safety shutdown; its output is 0 or 1.
- Truth table
- All input combinations with their outputs; used to check a circuit meets the problem.
Homework 1 min
Task (≤ 15 min): A fridge alarm (X) sounds if the door is open and has been open for over 2 minutes, or if the temperature is above 8 °C while the door is closed. Inputs: D = 1 door open; M = 1 open for over 2 minutes; T = 1 temperature above 8 °C. Write the expression, describe the circuit and complete the truth table.
Model answer
X = (D AND M) OR (T AND NOT D)
- AND gate (D, M); NOT gate on D; AND gate (T, NOT D); OR gate joining both AND outputs.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| D | M | T | D AND M | T AND NOT D | X |
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |