Digital circuit with D-flops and need to deal with asynchronous signal

Click For Summary

Discussion Overview

The discussion revolves around the design of digital circuits using D flip-flops (D-flops) and the handling of asynchronous signals, particularly focusing on the concept of metastability and the effectiveness of using double flopping as a mitigation strategy. Participants explore theoretical and practical implications of these designs.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant questions how double flopping benefits against metastability, suggesting that the unknown state from the first flop could still propagate to the second flop.
  • Another participant asserts that a series connection of flip-flops allows the input signal to stabilize over one clock cycle, but expresses confusion about the effectiveness compared to a single flop followed by combinational logic.
  • A different participant explains that the first flip-flop can oscillate if the asynchronous signal arrives at an inopportune time, and the second flip-flop can block these oscillations from propagating further.
  • One contributor shares a method involving an AND gate to enable the data line into the first latch, suggesting that this can prevent metastability by controlling when data transitions reach the latch.
  • Another participant reflects on the benefits of double flopping, emphasizing that it provides a full cycle for the metastable state to settle, contrasting it with a scenario where combinational logic is present, which could reduce the settling time.
  • A later reply highlights that some flip-flops may not oscillate but instead stabilize at a midpoint voltage, which could lead to power issues in connected logic gates, reinforcing the idea of avoiding combinational logic between flip-flops.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and agreement regarding the effectiveness of double flopping and the implications of metastability. There is no consensus on the best approach, and multiple competing views remain on how to effectively handle asynchronous signals in digital circuits.

Contextual Notes

Participants discuss the limitations of existing literature on the topic, noting that many digital design books may lack detailed explanations regarding metastability and the benefits of double flopping. Additionally, there are unresolved concerns about the behavior of flip-flops under specific conditions and the impact of combinational logic on metastability.

lostinxlation
Messages
38
Reaction score
0
Suppose you design the digital circuit with D-flops and need to deal with asynchronous signals. Typical logic is receiving the async signal with a D flop followed by another D flop to deal with metastability. But how does double flopping benefit against the metastability ?

The first flop gets the async signal transitioning just around the rise edge of the clock, and this flop capatures the unknown state somewhere between 0 and 1. This propagates to the slave latch of the said flop on the fall edge of clock and goes out. The next flop captures this unknown state signal and pass it to its master latch... Eventually, doesn't this unknown state come out of slave latch of the 2nd flop ? If so, how does double flopping reduce the chance of metastability ?
 
Engineering news on Phys.org


Series connection of flip flops allows the input signal to have 1 clock cycle to go to the stable 0 or 1 state.
 


Cloudscape said:
Series connection of flip flops allows the input signal to have 1 clock cycle to go to the stable 0 or 1 state.
That's what most of the books say, but that's what I don't get either.

If you have a combinational logic driven by a single flop and this flop goes into metastability, that metastable signal also has a whole cycle to settle, doesn't it ?
Once one of the flops goes into metastable condition, you can't predict when this settles and following logic, either flops or comb logic, would be affected by the metastable signal anyway. I don't don't get what difference double flop makes as opposed to a single flop followed by comb logic.
 


I think this link explains it well.
http://www.asic-world.com/tidbits/metastablity.html

Basically if an input is async you cannot prevent the first flipflop from oscillating it's Q inside the cycle if that async edge hits the flipflop wrong (i.e. a timing violation). Assuming the flipflop is designed such that the oscillations will stop before the next synchronous edge of clock (usually a good assumption), the second flipflop blocks the oscillations from the first flipflop preventing it from propagating to the rest of the circuit.
 


I suspect you are worried about the improper data state being transferred from the first latch to the next and into the following circuitry. If I remember right from some 25 years ago, I got around that problem by using the clock signal to enable the data line into the first latch.

If you provide an AND gate prior to the latch to enable the data signal to the latch but allow that same clock to be the latch clock, data transitions cannot reach the latch until shortly after the prior clock edge. This prevents the metastate scenario from ever occurring.

The worst case data delay scenario is merely 99% of one clock. Double latches delay more or won't prevent the error depending on which arrangement you use.

I had to use that data enable method for one of NASA's common memory bank processors that had 64 somewhat randomly timed memory requests coming from 64 processors. It improved the performance of what they had been using.
 


thanks.

I think I somehow understand how double flopping benefits.

Yes, the short answer is Let's give a full cycle to metastable state to settle like many books say. But I believe this simple statement should be accompanied by a little more details(which is lacking in many digital design books).

Assuming the receiving clock is running at 5ns cycle time. If you have double flops and the 1st flop goes into metastable state, it has 5ns to settle because of a flop to a flop connection. However, if you have a flop followed by comb logic which is, for example, 3ns deep before reaching the next sequential cells and this flop goes into metastable, the metastable state has virtually only 2ns to settle to avoid the weird state from getting captured by the next flop. This increases the chance that metastability not be resolved within a cycle and creates a big mess in the following blocks.
 
Last edited:


lostinxlation, sounds like you understand it well enough and I think what you wrote is correct. The fact that the combinational logic reduces the required time to settle is why there is usually no logic in between the sync flipflops.

There is also another subtle problem though and this requires some understand of how the gates are actually made. Some flipflops don't oscillate their output but instead their Q sits at Vd/2 until it restabilizes.

Take a simple case where the gates are CMOS and the combo logic is just an inverter. If that inverter's input voltage is Vd/2 then it is likely sitting at a point where both it's top and bottom FET are conducting. This is very bad for power as the total resistance from Vd to Vs will be low, and if one stays in this state for too long then there is a possibility of burning out this gate ruining the circuit.

To avoid all these problems (the problem you mentioned and the problem I mentioned) people usually just don't put combinational logic between the flipflops. It makes it easier.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
5K
Replies
8
Views
2K
Replies
5
Views
9K
  • · Replies 2 ·
Replies
2
Views
31K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K