← Teacher guides

Teacher guide: From gates to a processor

For Years 9–10, after Data representation's logic gates lesson: combine gates into circuits, add binary numbers with full adders, store a bit in a latch, then run programs on a tiny processor clock tick by clock tick.

Open the student course · How the ideas build

Each lesson works two ways. Students can work through the online tutorial at their own pace (it checks their answers and saves their progress in their browser), or you can teach it to the whole class from the slides, then send students into the tutorial for the Modify and Make steps.

Every lesson guide has plain-language notes, the answers to every check, a solution for every task, and slides and a worksheet for Waypoints Prepare. These guide pages are not linked from student pages, but they are not secret either: keep printed Teacher editions for answers you do not want students to find.

Whole-course cheat sheet: Open to print (every command, grouped by unit: a handout for the final challenge)

Building with gates

Circuits from truth tables, then adding binary numbers with gates.

Building with gates in 5 minutes (read before teaching this unit)

The idea in plain words

A logic gate takes bits in and gives one bit out (AND, OR, NOT, and combinations like NAND and XOR). Wire one gate's output into another's input and you get a circuit: work it out row by row, each gate using the bits that arrive on its own wires. Any truth table can be built from AND, OR and NOT, and even from NAND gates alone.

Adding is a truth table too. A half adder adds two bits: sum = A XOR B, carry = A AND B. A full adder also takes a carry in from the place to its right. Chain one full adder per place and the carries ripple left: that is how a processor adds binary numbers. If the last carry has nowhere to go, the answer needs more bits (overflow).

Links

Data representation's Why binary: logic gates introduces gates, truth tables and the half adder; this course reviews them and goes further. Bits all the way down covers overflow.

What students get wrong

  • Every gate looks at the switches. Each gate uses only what arrives on its own wires.
  • In binary, 1 + 1 = 2. There is no digit 2: it is 0, carry 1.

The words

circuit, truth table, NAND, XOR, half adder, full adder, carry, overflow.

Cheat sheet: Open to print (A4, with board pictures) · Open in Print · Markdown

A machine that remembers

A latch that stores a bit, then a tiny processor that fetches, decodes and executes.

A machine that remembers in 5 minutes (read before teaching this unit)

The idea in plain words

A latch is two gates whose outputs feed back into each other. Turn Set on and its output Q becomes 1; turn Set off again and Q stays 1, because the gates keep each other going. Reset makes it 0. That loop is a bit of memory. Put several latches side by side and you have a register that holds a number; billions of them (in a related form) make RAM, which is why RAM needs power.

A processor is gates, registers and memory together. Its program counter (PC) says which memory cell to use next. Each clock tick does one step of the fetch–decode–execute cycle: fetch the instruction from memory, work out what it means, do it. Instructions are just numbers in memory, like the data: a stored program. A 3 GHz processor ticks about 3 billion times a second.

Links

Inside a computer: RAM empties when the power goes off; GHz is clock speed; cores are copies of the processor. Bits all the way down: numbers wrap when they run out of bits.

What students get wrong

  • A latch forgets when Set goes off. It keeps its bit until Reset.
  • Instructions and data are different kinds of thing. Both are numbers in the same memory.

The words

latch, register, memory, clock, program counter, instruction register, accumulator, fetch, decode, execute, stored program.

Cheat sheet: Open to print (A4, with board pictures) · Open in Print · Markdown

Project briefs

Printable task sheets for assessment or extension: students make something, hand it in and explain their choices. The success criteria are the curriculum nodes' own. Open the briefs page

An alarm from gates (after combine)

A school store room needs an alarm. It should sound when the door is open or the window is open, but only when the key switch is off.

Design the alarm using AND, OR and NOT gates. Test it on every combination of the three inputs, and explain why the computer inside it works with only on and off.

Hand in:

  • A diagram of your alarm built from gates, with each input and the output labelled.
  • A complete truth table for your alarm, with one row for each combination of the three inputs.
  • Evidence that you tested it, such as screenshots from a logic simulator or a hand trace of each row.
  • A paragraph explaining why the alarm, and computers in general, use two states, on and off, and what the gates do with them.

Evidences:

  • Why binary — circuits and logic gates (AC9TDI8K04 node 3): Explains that binary maps to the two reliable states of electronic components; Demonstrates the output of AND and OR gates for given inputs; Connects logic gates to why digital systems are built on binary

Students can use a logic simulator the school approves, the site's gates board from the lessons, or paper. The design is (door OR window) AND NOT key, so the alarm should sound in exactly 3 of the 8 rows (key off, and the door or the window or both open): check that students work out each row rather than copying one. Look for students who put the NOT in the wrong place, or who confuse OR with "exactly one". The last item is the node's main idea: two states are easy for electronics to tell apart reliably, so gates can be built from them and combined into any rule.