What is Metastability?

A state in which a flip-flop's output stays between 0 and 1 for a while when setup or hold time is violated. Asynchronous signals are passed through two flip-flops (a synchronizer) to guard against it.

Field: Logic circuits

Japanese name: メタステーブル

Two-flip-flop synchronizer Source clock domain Destination clock domain Source FF FF1 FF2 Async Direct Synced output Source clock Dest. clock Metastable risk Dest. clock FF1 output Unsettled FF2 output ~1 cycle If FF1 settles before the next edge, FF2 gets the correct value
Two-flip-flop synchronizer · View in diagrams

Why a flip-flop can hang between 0 and 1

A flip-flop stores its state in cross-coupled inverters, which have two stable points and one unstable balance point in between. If the data input changes inside the window defined by the setup time (before the clock edge) and hold time (after it), the latch can be left near that balance point. Positive feedback then amplifies the small imbalance with a time constant τ, but the closer it starts to balance, the longer resolution takes, with no hard upper bound. The output may sit at an intermediate voltage or switch late, and the final value is unpredictable.

Synchronizers and MTBF

With an asynchronous input, metastability can only be made rare, not prevented. A two-flip-flop synchronizer gives the first stage almost one clock period to resolve before the second stage samples it. Mean time between failures is approximatelyMTBF=etr/τT0×fclk×fdataMTBF = e^(t_r/τ) / (T_0 × f_clk × f_data), where t_r is the available resolution time and τ and T_0 depend on the flip-flop. Because t_r sits in an exponent, a third stage adds about one period and multiplies MTBF enormously: with τ = 20 ps, an extra 1 ns gives a factor of e50e^50, over 102110^21.

What a synchronizer does not fix

Each synchronized bit may capture a change one cycle early or late, so a multi-bit value such as 0111 to 1000 can arrive as 1111 or 0000. Counters therefore cross in Gray code, where only one bit changes per step, as with asynchronous FIFO pointers; arbitrary data uses a handshake or an asynchronous FIFO. A short pulse from a fast domain can fall between slow-clock edges and vanish, so it must be stretched or converted to a toggle. Crossing signals should come straight from a flip-flop, because a combinational glitch can be captured as a valid value.

Metastability vs. ordinary timing violations

In a single synchronous clock domain, a setup violation means the data path is too slow, and static timing analysis finds it; slowing the clock or speeding the path fixes it. Across asynchronous clocks there is no fixed phase relationship, so violations happen eventually no matter how fast the logic is, and timing analysis cannot close them. That is why designs rely on CDC (clock domain crossing) verification, where tools find every crossing and check for a proper synchronizer, Gray-coded pointer or handshake. Such bugs are rare, so ordinary simulation seldom catches them.

Try it: questions about Metastability

How does the mean time between failures (MTBF) due to metastability change when a two-flip-flop synchronizer is extended to three stages?

  1. AThe time available for metastability to resolve increases by about one period, and MTBF grows exponentially
  2. BMTBF increases 1.5 times, in proportion to the number of stages
  3. CHow likely metastability is depends on the input side, so MTBF does not change
Show answer and explanation

Answer: A. The time available for metastability to resolve increases by about one period, and MTBF grows exponentially

Synchronizer MTBF is approximatelyMTBF=etr/τT0×fclk×fdataMTBF = e^(t_r/τ) ÷ (T_0 × f_clk × f_data), where t_r is the time available for metastability to resolve and τ and T_0 are constants determined by the flip-flop's characteristics. Adding a stage extends t_r by about one period (precisely, one period minus the flip-flop's clock-to-output delay and setup time). For example, with τ = 20 ps, increasing t_r by 1 ns multiplies MTBF by e50e^50, more than 102110^21 times. The probability of the first stage going metastable is unchanged, but the probability that it resolves before propagating further rises sharply.

FAQ

What causes metastability in a flip-flop?

Data changing within the setup-and-hold window around the clock edge, which leaves the internal latch near its unstable balance point. It is unavoidable when the input is asynchronous to the clock.

Why are two flip-flops used to synchronize an asynchronous signal?

The first flip-flop may go metastable, and the second samples it a full clock period later, by which time it has almost certainly resolved. This raises MTBF exponentially but does not make failure impossible.

Can a synchronizer be used for a multi-bit bus?

Not bit by bit, because different bits can be captured on different cycles and produce an invalid intermediate value. Use Gray code for counters, or a handshake or asynchronous FIFO for general data.

Questions that mention Metastability (6)

Metastability appears in 7 practice questions across 3 topics, including Timing analysis and CDC, Logic circuits, IC design flow and EDA.

  1. Which correctly describes the setup time of a flip-flop?
  2. What is the verification called that uses dedicated tools to check whether synchronizers are correctly inserted where signals pass between circuits running on different clocks?
  3. Why must the output of combinational logic in the sending clock domain not be fed directly into a synchronizer in the receiving domain?
  4. Each bit of 4-bit data is passed to another clock domain through its own two-stage synchronizer. What problem can occur when the data changes from 0111 to 1000?
  5. A pulse that is 1 for only one cycle (2 ns) in a 500 MHz clock domain is passed to a 100 MHz domain through a two-stage synchronizer. What problem can occur?
  6. Why are the write and read pointers of an asynchronous FIFO converted to Gray code before being synchronized into the other domain?

Books on Logic circuits Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

Comparisons that include this term

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary