D-latch & edge-triggered D-type flip-flop

Thread Starter

qwerty159

Joined Apr 16, 2012
1
The difference between a D-latch and an edge-triggered D-type flip-flop is that the latch:

A)
is controlled by the logic level at its ENABLE input rather than a CLK transition.
B)
always "latches" the Q output to the D input regardless of other inputs.
C)
triggers on either the rising or falling edge of an ENABLE signal rather than the CLK input logic level.


Thanks..I had a test and this is the only one I got wrong. I can't figure out this one.
 

Ron H

Joined Apr 14, 2005
7,063
The difference between a D-latch and an edge-triggered D-type flip-flop is that the latch:

A)
is controlled by the logic level at its ENABLE input rather than a CLK transition.
B)
always "latches" the Q output to the D input regardless of other inputs.
C)
triggers on either the rising or falling edge of an ENABLE signal rather than the CLK input logic level.


Thanks..I had a test and this is the only one I got wrong. I can't figure out this one.
The Q output of a D latch follows the D input while enable is asserted. Q latches to the value present at D at the instant when enable is deasserted.
I suppose the answer is A, but it could be C, depending on how you interpret "triggers". It latches on an edge of enable, but I wouldn't say it "triggers".
 

jimkeith

Joined Oct 26, 2011
540
A. Otherwise known as a "transparent latch" that behaves like a buffer until the clock goes inactive--at which time it latches the current information--the term "enable" is not a good expression because it could also refer to enabling the tri-state output should it be present
 

WBahn

Joined Mar 31, 2012
30,062
With one caveat, I also agree that the answer is A.

It is NOT answer C because saying that it triggers at either edge indicates that it is only able to change state at those two events. I think Ron H was thinking of interpretting the term "trigger" in the vein of it triggering a sensitive state at the rising edge and a nonsensitive state at the falling edge. I would argue that this is not a reasonable interpretation of the offered answer because the same word was used to describe the behavior at each event and the necessary interpretation requires a different behavior, and thus a different description, at each event. Furthermore, the description is ambiguous with respect to which state of the CLK signal it is sensitive in.

The caveat that I mentioned is that there does not appear to be anything approaching universal agreement on what is meant by a 'latch' and what is meant by a 'flip-flop'. I have seen numerous texts refer to cross coupled NAND gates as an RSFF (RS-type flip-flop). I have seen books assert that they are synonomous and merely imply the presence of a memory element of some kind. Others maintain that a latch has NO clock or enable input (such as the cross coupled NAND gates) while a flip flop has one or the other. The interpretation at play here is that a latch has level-sensitive clock, otherwise known as a strobe or a write-enable, while a flip-flop has an edge-sensitive clock. This school maintains that the cross coupled NAND gates meet this definition and that the circuit merely has two level-sensitive enable signals the each control a different transition.
 

MrChips

Joined Oct 2, 2009
30,810
I would not get too hung up with the semantics surrounding "latch" and "flip-flop".
There is the generic usage versus the precise hardware functional definition.

Generic usage

There are three types of transitory 2-state devices: monostable, bistable and astable.
A flip-flop is a bistable device - it has two stable states.

A latch is a memory device - one that retains data. Hence a latch can be implemented using a flip-flop.

Hardware usage

A latch is transparent when the ENABLE is active- the output follows the input while the ENABLE is active. Data is retained when the ENABLE is removed.

A flip-flop can be a SET-RESET flip-flop which will change state on assertion of either SET or RESET but not both.

A flip-flop can also be a CLOCKED flip-flop where the data is captured and output changes state on either the leading or trailing edge of the CLOCK.

In a MASTER-SLAVE flip-flop, data is captured on the leading edge and the output changes state on the trailing edge of the CLOCK.
 

WBahn

Joined Mar 31, 2012
30,062
Even assuming that the descriptions you give are universally accepted as the "official" descriptions, the fact is that there are many different practical definitions that are at odds with each other, as evidenced by the differences in the many text books on my shelf. My point was not to argue about semantics or what the 'right' definitions may or may not be. My point is it that it is not only important for you to be precise and consistent with how YOU use terms, but also to be aware of common situations in which you might be interacting with someone else that may also be being precise and consistent with how THEY use those same terms and the problem is that you are both working from slightly different definitions. In fact, spotting that this was happening would be a lot easier if both parties were working from wildly different definitions - the similarity is frequently enough to mask the fact that the subtle differences are causing a miscommunication.

The second point, which was unstated, is that by being aware of the different ways terms are commonly used, in practice and including common sloppy usage, it makes it possible to look at a problem and go down your little mental list of possible meanings, from the writer's standpoint, and figure out which usages are and aren't consistent with the problem statement. It also allows you to better interact with the writer, when that is possible, or to possibly work the problem from a few different interpretations and caveat the solutions accordingly. Developing this skill is as valuable working homework assignments as working with a customer to design their next widget.
 
Last edited:

Ron H

Joined Apr 14, 2005
7,063
Being a 71 year old retired engineer, I have experienced these ambiguities for the better part of 50 years. You have to look at the context of of the situation, and maybe even ask for clarification.
We forum trolls seem to have the propensity for beating a topic to death.:D
 
Top