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

In summary, double flopping is a technique used in digital circuit design to reduce the chance of metastability when dealing with asynchronous signals. By using two consecutive flip flops, the input signal has one full clock cycle to settle into a stable state, compared to a single flop followed by combinational logic which only allows for a shorter settling time. This reduces the risk of unpredictable states being captured by subsequent flip flops and causing errors in the circuit. Additionally, the use of double flopping also helps prevent damage to gates and improves overall circuit performance.
  • #1
lostinxlation
38
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
  • #2


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


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.
 
  • #4


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.
 
  • #5


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.
 
  • #6


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:
  • #7


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.
 

1. What is a D-flop in a digital circuit?

A D-flop, also known as a D flip-flop, is a type of sequential logic circuit that stores one bit of data. It has two stable states, 0 and 1, and can be used to store and transfer data in digital circuits.

2. How does a D-flop differ from other types of flip-flops?

A D-flop differs from other flip-flops, such as the S-R and J-K, in that it has a single input (D) and a single output (Q). This makes it simpler to use and less prone to errors.

3. What is the purpose of dealing with asynchronous signals in a digital circuit with D-flops?

Dealing with asynchronous signals in a digital circuit with D-flops is important because it allows for the proper synchronization of data. Asynchronous signals are signals that do not have a fixed clock cycle and can occur at any time, so special techniques must be used to ensure the proper transfer of data.

4. How do you handle asynchronous signals in a digital circuit with D-flops?

To handle asynchronous signals in a digital circuit with D-flops, a technique called "pulse-triggering" is commonly used. This involves using a special type of D-flop called a master-slave D-flop, which uses two D-flops connected in series to ensure proper synchronization of the data.

5. What are the benefits of using D-flops in a digital circuit?

D-flops offer several benefits in digital circuits, including simplicity, reliability, and the ability to store and transfer data. They are also commonly used in clocked circuits, where a clock signal is used to control the timing of operations and ensure proper synchronization.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
5K
  • Computing and Technology
Replies
2
Views
31K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
8K
Back
Top