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.

Press Clock: Q takes D. Flip D, and nothing happens until the next press.

How it works

  1. 01

    While the clock is off, the first latch copies D and the second holds Q.

  2. 02

    When the clock comes on, the first latch freezes and the second copies it: Q takes the value D had at that instant.

  3. 03

    While the clock stays on, changing D does nothing, because the first latch is closed.

Every circuit in the library