Cover lesson · Computer Science · Year 10 · Intermediate

Logic gates in real life

DCF: Data and computational thinking → Problem-solving and modelling

Name: Class: Date:

Cover teacher — you need no subject knowledge and no computers

Print: this sheet, one per pupil. Everything needed is on it, including a reference table of what each gate does. Rulers are useful for the circuit diagram; nothing else is.

Run: 5 min read the gate reference table · 25 min scenarios A to D, one Boolean expression and one truth table each · 10 min scenario E, the three-input one, plus its circuit diagram · 10 min the "find the fault" question.

Collect: this sheet. Every truth table has exactly one correct set of output values and they are all printed on the worked example sheet, so marking is a tick-and-compare job.

What you are doing

Logic gates are not only inside processors. They are the rule behind a car light, a microwave door, a fire alarm and a landing light. For each of five real situations you will name the inputs, write the situation as a Boolean expression, and complete the truth table that proves your expression behaves the way the real device does.

Step by step

  1. 5 min — Read the gate reference table until you can say what each gate outputs without looking.
  2. 25 min — Scenarios A to D. For each one: name the inputs, write the expression, complete the truth table.
  3. 10 min — Scenario E has three inputs, so its table has eight rows. Complete it and draw the circuit.
  4. 10 min — Find the fault in the alarm that was wired up wrongly, and use a truth table to prove what goes wrong.

Gate reference

1 means true, on, pressed or detected. 0 means false, off, not pressed or not detected.

GateOutput is 1 when…Behaviour for inputs 00, 01, 10, 11
ANDboth inputs are 10, 0, 0, 1
ORat least one input is 10, 1, 1, 1
NOTthe single input is 0NOT 0 = 1, NOT 1 = 0
XORexactly one input is 10, 1, 1, 0
NANDthe inputs are not both 11, 1, 1, 0

Scenario A — the car interior light

The light inside a car comes on if the driver's door is open, or the passenger door is open, or both.

Inputs: D = _______________________   P = _______________________

Expression: L = _______________________

DPL (light on)
00
01
10
11

Scenario B — the microwave

The microwave only heats when the door is closed and the timer is running. If either is not true, nothing happens.

Expression: M = _______________________

C (door closed)T (timer running)M (heating)
00
01
10
11

Why is it important that this is AND and not OR?

Scenario C — the fire alarm with a silence button

The sounder goes off when smoke is detected, unless a member of staff is holding the silence button down during a test.

Expression: A = _______________________

S (smoke)T (silence held)NOT TA (sounder)
00
01
10
11

Scenario D — the landing light with two switches

There is a switch at the bottom of the stairs and one at the top. Flicking either switch changes the light: if it was on it goes off, if it was off it comes on. Both switches down means off; both up also means off.

Expression: L = _______________________

A (bottom switch up)B (top switch up)L (light on)
00
01
10
11

Scenario E — the greenhouse fan (three inputs)

The school's polytunnel has an extractor fan. It runs automatically when it is hotter than 28°C and the window is closed — there is no point extracting air through an open window. The gardener can also force it on with an override button at any time.

Inputs: H = hotter than 28°C   W = window closed   O = override pressed. Output: F = fan runs.

Expression: F = _______________________

HWOH AND WF
000
001
010
011
100
101
110
111

Draw the circuit: two gates, three input lines on the left labelled H, W and O, one output on the right labelled F.

Find the fault

An electrician wires the fire alarm from scenario C as A = S OR (NOT T) instead. Fill in the table, then say in one sentence what the caretaker will experience on a normal quiet afternoon.

STNOT TA = S OR (NOT T)
00
01
10
11

Success criteria

If you finish early