In my signal processing class, my professor said using TWO flip flop can avoid metastability. But he didn't explain it well. I wonder if anyone could enlighten me here? Thanks in advance!
-
Adding flip flops in chain don't actually avoid metastability, it just increases MTBF => decreases metastability probability at the output. 'Two Flip-Flops' is just a widely accepted metric for low-medium speed designs. – Mitu Raj Dec 03 '21 at 19:14
-
1"Avoid" doesn't mean "prevent". If you dramatically increase MTBF, that counts as "avoidance". – TimWescott Dec 03 '21 at 19:53
2 Answers
Two flip flops cannot avoid metastability. Not even three or four. But they can make it a lot less likely, much, much less likely.
Once you've reduced the rate that metastable events happen from something observable like a few times a second or once a day, to once in the age of the universe, you can be forgiven for saying that it's 'cured'.
The trick is to wait long enough. You delegate the waiting to a pipeline of DFFs so that you don't have to slow down the system clock. Two in the pipeline is often enough, but sometimes you need three or four to meet a very tough specification.
See this Q/A for more information.

- 158,152
- 3
- 173
- 387
Whatever answer it was previously, "TWO flip flop CAN avoid metastability" if the cycle time can meet the setup and hold timing.
The underlying idea is that the first stage may run into metastable state due to the insufficient setup and hold time of the input signal, but the second stage sees the output of the first stage, settles soon enough, before the following cycle comes to the setup time begin, and delays (propagation delay) enough to meet the hold time, thus satisfying both of the setup and hold time. That is where the TWO comes.
A broader and in-depth discussion goes to synchronization, sampling theory, bandwidth, statistics, and etc. This is one example that you can see how far it can go.
Edited.
In the Wikipedia, This is where the metastability came from. This is where metastability in digital logic is discussed.
This one is from academia, that I agree with:
In theory a flip-flop in this quasi-stable state could remain there indefinitely – but in reality it won't. In a practical circuit, cascading two flip-flops practically squares the probability of failure. With two flip-flops, and at reasonable data rates, errors occur millions or even billions of years apart.

- 3,781
- 8
- 24
-
What was wrong? At least, someone can tell me why, please. I wouldn't get upset. I usually give up-votes to different opinions. Difference is how we progress – jay Dec 03 '21 at 20:34
-
1What was wrong? "can meet the setup and hold timing." if a signal meets both setup and hold times metastability does not occur at all. – WhatRoughBeast Dec 03 '21 at 22:15
-
1Neil's answer is correct. Chaining flip-flops just reduces the probability of metastability, it cannot, however, avoid it altogether. If the first flip-flop is metastable it could take a very long time (potentially forever) for it to settle. If it doesn't settle within one clock time then the second flip-flop could also go metastable. Luckily, the time between metastable events increases extremely rapidly with the number of flip-flops so two is often enough to get the times to such a level that it is not an issue. High clock-rate systems may need more than 2 though. – Kevin White Dec 03 '21 at 23:47
-
@WhatRoughBeast , Yes, that is how the first stage gets into metastability. The second stage is there to resolve it. – jay Dec 04 '21 at 00:49
-
--1-- @KevinWhite In the Wikipedia, [This is where the metastability starts.](https://en.wikipedia.org/wiki/Metastability) [This is where metastability in digital logic is discussed](https://en.wikipedia.org/wiki/Metastability_(electronics)). – jay Dec 04 '21 at 01:42
-
--2-- Long story short, I agree with these: [In theory a flip-flop in this quasi-stable state could remain there indefinitely – but in reality it won't. In a practical circuit, cascading two flip-flops practically squares the probability of failure. With two flip-flops, and at reasonable data rates, errors occur millions or even billions of years apart.](http://www-classes.usc.edu/engr/ee-s/552/coursematerials/ee552-G1.pdf) – jay Dec 04 '21 at 01:42
-
@jay - You really don't understand. A metastable state does not persist for a limited time, after which you can sample it safely. Instead, a metastable state persists for a random period, with the probability that it has not resolved normally being an inverse exponential function of time. Adding a second FF does not necessarily resolve the issue, but it does reduce the error rate. Some systems use more than two stages. – WhatRoughBeast Dec 04 '21 at 20:57
-
@WhatRoughBeast, I agree with you, in a way: "does not necessarily resolve". Meantime, it has been some time since the concept of metastability gained popularity in logic theory, due to the sense of mystery. Hope you pay some time, and look around what it really means to you. – jay Dec 04 '21 at 22:42