← 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

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) · 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) · Markdown