Students set and reset a latch made of two NOR gates, see it keep its bit with both switches off, and store a number in a 4-bit register of latches (AC9TDI8K04 node 3, extended; the kit names adder circuits as going further).
From gates to a processor · A machine that remembers · about 40 minutes · Open the student lesson
Classroom resources
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
SlidesDownload Present from the browser, or export to PowerPoint or PDF.
WorksheetDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can explain how a latch remembers a bit.
I can say what Set and Reset do, and what happens with both off.
I can store a number in a register and explain why it stays.
Timing
Predict and Try 6 min · Worked example 10 min · Vary 12 min · Practise and Make 12 min
Before class
Try the boards yourself.
The one idea: a loop of gates keeps its bit. This is the first circuit whose output depends on what happened before, not only on its inputs now.
The board's register Store button stands in for a clock signal (a D flip-flop in real chips); the lesson keeps that detail out. Real RAM mostly uses capacitors (DRAM) rather than latches, with latches (SRAM) in caches and registers; both need power.
Running the lesson
Predict: students who said 0 hold Sam's misconception; Try settles it.
Try: ask which wire carries the memory.
Worked example: trace the both-off row: what does each gate get?
Vary: after both on, ask why designers avoid it.
Make: ask what the register would hold after one more Store.
The hard part (on purpose)
Feedback is strange: an output that is also an input. Don't explain the NOR details first; let students see Q stay 1, then trace why.
When students get stuck
What you will see
A question to ask
The fix
A student says the latch is just a lamp (Sam's mistake).
What is Q with both switches off, after Set? After Reset?
Different answers for the same switches: it remembers.
A student changes the data and expects the register to follow.
When does the register copy the data?
Only on Store (in a processor, on a clock tick).
Answers to the checks
on, then off: A latch has a Set switch and a Reset switch. Turn Set on: Q becomes 1. Now turn Set off again. What is Q? Still 1. Each gate's output keeps the other gate in the state that holds Q at 1, until Reset changes it.
Try: set it and let go: Turn Set on, then off. Is Q still 1?
Q stays 1 with both switches off: the latch remembers one bit.
Four settings: Q is 1. Reset goes on, then off again. What is Q now? 0 Reset sets Q to 0; letting go keeps it at 0.
Find the mistake: Sam explains the latch. Click the line where it first goes wrong. line 2 Line 2: a latch is not a lamp. With Set and Reset both off, Q keeps the 1: that is memory.
Why RAM forgets: Why does RAM lose everything when the power goes off? Its bits are held by circuits like latches, which need power to keep feeding each other No power, no loop, no bit. Storage keeps data a different way (magnetism or trapped charge).
Reset: Set Q to 1, then reset it to 0, then turn both switches off. Does Q stay 0?
Reset and let go: Q stays 0. Either bit, the latch keeps it.
Both on: Edge case: turn Set and Reset on together. What happens to Q and not Q?
Both outputs become 0, so "not Q" isn't the opposite of Q any more. Real circuits are designed so this never happens.
Store a number: The register is four latches. Set the data switches to 9 and press Store.
1001 stored: each bit in its own latch.
Keep it: Now set the data switches back to 0 without pressing Store. What does the register hold?
Still 9: the register only changes when you Store. In a processor, the clock does the storing, many times a second.
Register size: A register is 8 latches side by side. What is the biggest number it can hold? 255 8 bits: 0 to 255.
RAM in bits: A computer has 8 GB of RAM. About how many bits is that? About 64 billion 8 billion bytes × 8 bits = about 64 billion bits, each held by a tiny circuit.
Review: RAM and storage: Review: which part keeps your files when the computer is switched off? Storage Storage (SSD or hard disk) keeps data without power.
hold a number: Make the register hold 12 while the data switches show 3.
The register remembers 12 whatever the switches say, until the next Store. That is what a processor's registers do between clock ticks.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: latches and a register › Reset
Open task: any program that does what the step asks.
Vary: latches and a register › Both on
Open task: any program that does what the step asks.
Vary: latches and a register › Store a number
Open task: any program that does what the step asks.
Vary: latches and a register › Keep it
Open task: any program that does what the step asks.
hold a number
Open task: any program that does what the step asks.
Stretch and support
Stretch: Look up a D flip-flop. How does it make sure the register changes only on the clock tick?
Support: A four-row table: S, R, Q after. Students fill it from the board.
Exit ticket
Set goes on then off, then Reset goes on then off. What is Q after each step, and why does the latch count as memory?
1, 1, 0, 0. With both switches off it keeps its last value, so its output depends on what happened before.
What each step is for
on, then off: Committing to what Q does after Set goes off tests the new move: a loop of gates keeps its bit.
Try: set it and let go: Setting and releasing on the latch settles the prediction: with both switches off, Q keeps its bit.
Worked example: the latch's rules: Working through the four switch settings models the new move, including the one that keeps the old value. Sam treats the latch like a lamp, the misconception planted after the method.
Vary: latches and a register: Each task changes one thing: reset and release, both switches on (the edge case), then four latches as a register that stores and keeps a number.
memory: Reasoning about latches and registers without the board is the same move, plus reviews of bits and of RAM against storage.
hold a number: Leaving the register holding one number while the data switches show another reverses the process: students decide what is stored and prove it stays.
Where it leads
Next: A tiny processor (fetch, decode, execute).
Links: Inside a computer (RAM empties without power; storage keeps data).