Feed two gates' outputs back into each other and they hold a bit: a latch. Set makes it 1, Reset makes it 0, and with both off it keeps what it had. Latches side by side make a register that stores a number.
A gate's output changes the moment its inputs change. So how does a computer remember anything?
Every gate so far forgets: change its inputs and its output changes straight away. To remember, a circuit needs a loop: outputs fed back in as inputs.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
On, then off
TryTry it on the board and compare the result with your prediction.
Try: set it and let go
Was your prediction right? Follow the dashed wires: each NOR gate's output goes into the other.
Try it yourselfYour edits are saved in this browser.
Turn Set on, then off. Is Q still 1?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: the latch's rules
Worked exampleBefore each step, say what you think comes next.
S=1,R=0⇒Q=1Set: the bottom NOR's output goes to 0, which lets the top one make Q = 1.
S=0,R=0⇒Q staysBoth off: each gate's output holds the other where it is. This is the memory.
S=0,R=1⇒Q=0Reset: the top NOR's output goes to 0.
S=1,R=1Not allowed: Q and not Q both become 0, which makes no sense for one bit.
Now try Reset.
Sam explains the latch. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: latches and a register
Try it yourselfYour edits are saved in this browser.
Set Q to 1, then reset it to 0, then turn both switches off. Does Q stay 0?
Use the board. This ticks when you get there.
Edge case: turn Set and Reset on together. What happens to Q and not Q?
Use the board. This ticks when you get there.
The register is four latches. Set the data switches to 9 and press Store.
Use the board. This ticks when you get there.
Now set the data switches back to 0 without pressing Store. What does the register hold?
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Memory
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Hold a number
Then: what would you need to store 16 bits?
Try it yourselfYour edits are saved in this browser.
Need a hint?
12 is 8 + 4.
Another hint
Set 1100, press Store.
Another hint
Then change the data switches to 0011 and don't press Store.
Make the register hold 12 while the data switches show 3.
Use the board. This ticks when you get there.
For teachers
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). About 40 minutes.
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.
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
A student says the latch is just a lamp (Sam's mistake). Ask: What is Q with both switches off, after Set? After Reset? Fix: Different answers for the same switches: it remembers.
A student changes the data and expects the register to follow. Ask: When does the register copy the data? Fix: Only on Store (in a processor, on a clock tick).
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.
Where it leads
Next: A tiny processor (fetch, decode, execute).
Links: Inside a computer (RAM empties without power; storage keeps data).
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.
Now you can
Explain how a latch remembers a bit.
Say what Set and Reset do, and what happens with both off.
Store a number in a register and explain why it stays.