Metastability – Part 1: Introduction, Causes and Effects

Metastability – Part 1: Introduction, Causes and Effects


hello and welcome to electroTuts, in this
video we will be looking at the concept of metastability in detail. So, let’s get started. We have learnt from previous videos on Static
timing analysis and interview questions that when dealing with sequential circuits like
flip-flops some conditions must be followed. Input to the flip-flop must remain stable
atleast setup time before the clock edge, i.e. this time must be greater than Ts, setup
time. Input D must not change in this region before
the clock. Also another condition is imposed that says
the input D must be stable atleast hold time after the clock edge, i.e. this time must
be greater than Th. The input D must not change in this region
after the clock Now here comes an obvious question, what happens
when the input D is changing during the aperture time around the clock. Aperture time is another name for setup time
+ hold time. We know that if the input to the flip-flip,
D is stable at low value, during the aperture time, the output Q takes a low value, whatever
be the previous output. Similarly, if the input D is HIgh during the
aperture time, Q takes a High value. If the input D changes to a High or a Low
value during the aperture time, flip-flop captures a value partway between
Low and High and this state is called as metastable state, or a quasi-stable state. The output will eventually settle to a High/Low, but it can take unlimited amount of time to resolve into a good Low/High value. This whole process of flip-flop going into
a metastable state and then settling into one of the stable states, a high/Low state
is known as metastability. Moving further, let’s get some intuition about
what a metastable state is, through a common analogy. Consider a hill on a golf course, the valley around the hill can be related to the to stable states of a flip-flop
a high state and a low state, then the top of the hill becomes a metastable state. From position 1, if you hit the ball lightly,
it remains where ball 1 is, but if you hit the ball hard it crosses the hill and reaches
2 But if you hit the ball such that it lands
at the top of the hill and stays there even the slightest disturbances like the wind,
will make the ball fall to either 1 or 2. the hill top is the metastable state because
even if the ball can reach this state it can’t stay there infinitely in the real world because
of the noises and disturbances present. same goes true for any bistable device like
flip-flop, the flip-flop must go through a metastable state when transitioning from one
stable state to another. and transitioning during aperture time can
be compared to reaching and stopping at the top of the hill, where you know that the ball
will eventually fall but you don’t know the exact amount of time after which the ball
will fall. Now that you have an idea about what metastability
and metastable state is, let’s look at some possible causes for the metastability in a
system. If setup time constraint or hold time constraint
is not met for the system, the concept of setup time constraint or hold
time constraint is discussed in great detail in my previous videos on STA. If you want to know more about them, you can
look at my previous videos from the link in description below. If the input to a flipflop is asynchronous. this statement needs some more explanation if the input to the system is let’s say from
a button then you can’t predict when the button will be pressed. therefore you can’t ensure that the system
won’t go into the metastable state. let’s look at another example where the input
to the flipflop is asynchronous. if you connect two systems operating at different
frequencies or at the same frequency but different phase, then also the input to the receiving
system is asynchronous compared to it’s own clock domain. to explain this statement, lets have an example
of two systems A and B operating at different frequencies defined by CLKA and CLKB. Now let’s say A wants to share some data with
B. then because of different frequencies it can’t
be ensured that data received by B is not changing during the aperture time, so we can’t
ensure that the system isn’t going to a metastable state. After discussing so much about metastability, lets look at an obvious question. Why should we care Why should we care if the flip-flop goes into
the metastable state. we should care because, once a flip-flop goes
into the metastable state, the amount of time it takes to settle to one of the states is
unknown. so if the data output resolves before the
next flip-flop capture it, the system doesn’t get impacted negatively, but if it fails to resolve in the allotted
time, i.e. before it reaches the next flip-flop, it can cause system to fail and these failures
are very difficult to track down and even correct. so we need to ensure that the system avoids
going into a metastable state. In the next video, we ill be looking at the
methods to prevent metastability using synchronizers and an estimate used by designers to quantify
failure rates of a system. Thanks for watching this video, and if you
gained something from this video, hit the like button, and subscribe to this channel for more electronics
related tutorials.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *