D flip-flop
A D flip-flop takes its input D at one instant only: the moment the clock goes from off to on. The rest of the time it holds. It's two D latches in a row, the first open while the clock is off and the second while it's on, so D never runs straight through. Every register in a processor is built from these.
How it works
- 01
While the clock is off, the first latch copies D and the second holds Q.
- 02
When the clock comes on, the first latch freezes and the second copies it: Q takes the value D had at that instant.
- 03
While the clock stays on, changing D does nothing, because the first latch is closed.