# D Type Flip Flop Behavior

I look into the D-Type Flip Flop, so I checked it and found some logical diagrams, but they were all differents...

I have no idea what this gate do :

-Does it switch Q and /Q depending of the state of the clock and the activation of the other input :

Clock -> made the states switch only if the other input is true.

-Does if switch Q and /Q depending of the sate of the other input and refresh the output when the clock is true :

Input -> change the state depending on the input value, refresh the output when clock is true

So which one must I follow ? Another diagram ?

here is what I get : first one change the output depending of the clock state; the 2 other change their output depending on the input value. Refresh depending of the value of the clock.

Thanks,

• read through electronics-tutorials.ws/sequential/seq_4.html The internal structure of a D flip flop or the technology used is less important than what it does. Feb 16, 2017 at 12:39
• The first image you posted is not a D flipflop its a D latch which is a level triggered device not an edge triggered. IF(CLK==1) OUT=in; Else OUT=OUT; you should use the term Gate instead of clock usually clock is used when talking about FF Feb 16, 2017 at 13:24
• Unlike the 2nd image which is for a D flip flop. If(CLK.RISING) OUT=IN; Else OUT=OUT; so both images represents two different things Feb 16, 2017 at 13:36

A D Flip Flop will track its input 'D' in function of the clock. 'D' in this case stands for Data. Note that as shown in the picture below, the output 'Q' is only toggled high or low depending on the clock signal. Usually, a true value (1 or high) will trigger the input. If D goes high and the clock is low, it will wait until the rising edge of the clock to trigger Q high. So in general there are a few things to remember about a D Flip Flop:

• The output Q and /Q are only triggered in function of the clock
• It can be thought of as a memory cell
• It is also named a bistable multivibrator
• Memory units could have thousands/millions of flip flop tied together
• A basic shift register can be made out of D Flip Flops Finally, the picture below summarize essentially what I am trying to explain. A Flip Flop is clock triggered, and the output will follow the input upon a clock trigger. Look into D Latch if you are looking at a Flip Flop that would be "level sensitive" and D Flip Flop if you want something that is "edge sensitive". The output Q will only depend on the clock state and the input.

• I think there is something wrong with your diagram: Why are the first 0-->1 and the last 1-->0 transition of Q not happening at rising CLK?
– Curd
Feb 16, 2017 at 13:17
• @Curd I do not see what you are referring to? Clock diagram or truth table? I revised clock sequence and Q is triggered on rising edge every time. It holds its state if D is still high or still low. Feb 16, 2017 at 14:18
• I mean the waveform diagram. Look at first 0-->1 transition of Q or last 1-->0 transition of Q. There is no rising CLK.
– Curd
Feb 16, 2017 at 14:30
• BTW: I have also a problem with your truth table. It repesent rather a latch (level sensitive) not a D-FF (edge sensitive).
– Curd
Feb 16, 2017 at 14:39
• @Curd I edited the answer. You are right, I had a D Latch shown in the picture which is "level-sensitive" and not "edge-sensitive". Feb 16, 2017 at 14:50