Electronic – If the output of a D type flip-flop appears immediately on the clock edge, how can the previous output be used

-setupclockflipflop

The way I understand it, the input value (D) of a D type flip-flop appears immediately on the output (Q) of a D type flip when triggered by a positive clock edge. If this is the case, then how can the value before the clock edge be used as an input to another clocked flip-flop? According to this model, there's no particular value at all right at the edge of the clock.

Of course, flip-flops do work so it's my model of understanding which is wrong. So can anyone elaborate this a bit more?

Best Answer

If you scrutinize the data sheet for a real D-FF carefully, you will see an item called 'setup time'. In actuality, the FF doesn't grab the value at the exact time of the clock edge; the data has to be stable for the last 20 ns or so before the clock rises, and that's the value that gets transferred. Also, the value at the output takes a few ns to settle down to the (possibly) changed value. So if you daisy chain a string of D-FF's together, Q from one into the D of the next, everything works because during the critical time for each stage's D input, the Q's are stable; the Q's only change very shortly after the active clock edge.