D-latch & D-flip flop

Discussion in 'Digital Circuit Design' started by nanobyte, Oct 28, 2005.

  1. nanobyte

    Thread Starter Senior Member

    May 26, 2004
    118
    1
    What is the difference between a D-latch and a D-flip flop? Both seem to be doing the same thing; Q follows D.
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    Flip-flops are edge triggered, i.e. the output Q will only follow D at the edge of the clock; whether it be rising or falling edge is dependant on the flip flop design.

    Latches are transparent in the enable configuration, i.e. if the latch is enabled the output Q will follow the input D for all changes in D - there is no requirement for an clock edge like for a flip-flop.
     
  3. isha

    Active Member

    Sep 16, 2005
    36
    0
    i think both are same
    bcuz they do the same job
     
  4. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    Read my post above, they certainly don't do the same things. Flip-flops require clock edges, where as latches only require enabling or disabling. If you consider the output of flip-flops and latches for the same inputs and clock cycle (where for a latch the clock goes to the enable input), you will find that the outputs will be different.

    Look at the attached diagram showing the output of the latch QL and output if the flip-flop QFF for the same inputs and clock cycle. (Note: In this example the latch is enable-high and the flip-flop is rising edge triggered).

    [attachmentid=933]
     
    webcrawler likes this.
  5. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,280
    1,070
  6. nanobyte

    Thread Starter Senior Member

    May 26, 2004
    118
    1
    What's up everybody. Umm Dave, how come in your diagram the Q output for the flip flop is flat. Shouldn't it have some pulses in response to the clock edges (rising or trailing - which ever one it is suppose to respond to)?
     
  7. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    143
    Remember for the flip-flop the input D is latched to the output Q only on the rising edge of the clock. If you look at the diagram, for all rising edges of the clock the input D is low therefore the output Q never changes. (Note, for clarity I have ignored any delays in the timing diagram).

    I have noticed a small error is the output for the latch QL. After the last risng edge of the clock (rising edge number 3) the output QL should go temporarily low, until the input D goes high. Apologies for the mistake.

    Attached is a correction:
     
  8. blahgod

    New Member

    Nov 1, 2005
    1
    0
    for d FF: d=q on time of clk, @ NGT or PGT depending on the device
     
  9. webcrawler

    New Member

    Jun 15, 2016
    1
    0
    Why do they sometimes referred to D-flip flop as latch
     
  10. crutschow

    Expert

    Mar 14, 2008
    12,268
    2,981
    The newbie old-thread-reincarnator strikes again. :rolleyes:

    Flip-flops are sometimes called latches because technically they are edge-triggered latches.

    (Welcome to the Forum.
    It's a standing joke here that many first time posters bring back very old posts to comment on.
    In this case you've brought back one that's over 10 years old.)
     
    webcrawler likes this.
  11. Techno Tronix

    Member

    Jan 10, 2015
    140
    10
    In D-latch the output can changes according to the input where in D-flip-flop the output only changes according to the control signal from up to down or down to up.
     
  12. hp1729

    Well-Known Member

    Nov 23, 2015
    1,708
    182
    Authors and manufacturers may differ but I like Dave's definitions.
     
  13. WBahn

    Moderator

    Mar 31, 2012
    17,332
    4,662
    There's no hard and fast definition -- otherwise terms like "transparent latch" would be redundant while "edge-triggered latch" would be a contradiction in terms -- and some authors make no distinction between them at all, but rather use qualifiers (such as "transparent", "level-triggered", and "edge-triggered") to describe the key behavior; so you need to look at the data sheet for the particular devices you are considering to determine their behavior. If you don't and just assume that the device manufacturer is using the terms the same you are used to seeing them, then sooner or later you will get burned. Having said that, probably most people that make a distinction follow Dave's descriptions -- latches are level-triggered while flip-flops are edge-triggered.
     
Loading...