Skip to content
Tactiverge
  1. Stage 1
  2. Stage 2
  3. Stage 3
  4. Stage 4
  5. Stage 5
  6. Stage 6
  7. Stage 7
  8. Stage 8
  9. Stage 9 (this one)
  10. Stage 10
  11. Stage 11
  12. Stage 12
  13. Stage 13
  14. Stage 14
  15. 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

DQ0
CLKDQ

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

load

Q = 5

0
1
0
1

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.

  1. 1. Q = 0. D goes to 1 while the clock stays at 0. What is Q?
  2. 2. A 4-bit register holds 5. D = 9, load = 0, one clock pulse. What does it hold?