Re: metastability
in general metastability is an un avoidable behavior of circuit that may cause malfunction or failure when, this hazard can actually happen with any asynchronous signals passes to clocked circuit "this means that the signal can come from another uncorrelated clock clocked circuit", From a specification point of view, synchronous elements such as flip flops specify a Setup time and a Hold time. By its nature an asynchronous input cannot be reliably expected to meet this specification, and so it will have transitions that fall within the timing window that is bounded by these two specifications. When this occurs, the result can be one of three scenarios:
The state of the signal prior to the transition is used, the state of the signal after the transition is used or the flip flop goes metastable.
The third possibility is what matters here because in the two other situation the element will stay in it state or go to another state which is irrelevant to an asynchronous signal behavior.
So actaully asynchronous signal transition may violates the steup and hold time of the flipflop, however metastability actually occurs within a tiny timing window when the input doesnot violate the setup and hold timing specifications only but also when the flipflop accepts the new input, this causes an unstable equilibrium state under this symmertrically balanced transitory state is called the metastability. In fact the device may stop acting like a digital one and may act as an analog device, this also may cause a propagation of this situation to other cascaded elements in the circuit "you got a series of amplifiers for example", this may cause circuit failure or malfunction "not often to happen with CMOS". It is important to note that this behavior is described by what is called the Buriden principal which states that "A discrete decision based upon an input having a continuous range of values cannot be made within a bounded length of time", so actually the main problem lies due to the continuity of signal in time domain, the signal can lie between one and zero, and any continues signal needs an undertermined time to make right decision, it is funny to state that this principal holds in all physics, "including our daily descisoins". It is also impossible to determine how long such a state persists, so actually the metastability is described statistically, it is measured by the mean time between failure parameter (MTBF) which is inversely proportional to the product of the two frequencies involved, the clock frequency and the average frequency of the asynchronous data changes, provided that these two frequencies are independent and have no correlation.
To decrease the metastability hazard the most common technique is the metastability filter it might be a one or more FF, most commonly in nowadays designs is 2 cascaded FF, a metastability filter only decreases the metasatbility propability because it add a slack in its way.
that's all folks