Memory that ticks
09Registers
- Stage 1
- Stage 2
- Stage 3
- Stage 4
- Stage 5
- Stage 6
- Stage 7
- Stage 8
- Stage 9 (this one)
- Stage 10
- Stage 11
- Stage 12
- Stage 13
- Stage 14
- Stage 15
Explanation
Combinational logic forgets. To remember, we use a D flip-flop: on the rising edge of the clock (the instant it goes 0 → 1) it copies its D input to its output Q, and holds Q steady until the next rising edge, whatever D does in between.
Put several flip-flops side by side on one clock and you have a register. A load-enable input (a mux in front of each flip-flop) decides whether a clock edge takes the new value or keeps the old one. Every register in a processor works this way.
One D flip-flop
Change D as often as you like: Q only copies it at a rising edge. History (oldest first): clk 0 D 1 Q 0.
A 4-bit register with load-enable
Q = 5
With load = 0 a pulse keeps the old value: a 2:1 mux in front of each flip-flop feeds Q back to D.
Register holds 5
Check yourself
Marked instantly in your browser. Use the interactive above to work it out.