http://www.fpga-faq.org/FAQ_Pages/0017_Tell_me_about_metastables.htm
...apparently a discussion.
This site contains a lot of Free E-Books and all information about Electronics Enginering, EBooks, Algorithms, Software Books & Complete Micro Processor Guide
Tuesday, February 12, 2008
metastability of digital electronics
Terms of Digital Logic Metastability Definition
Definitions listed in Logical order.
Problem: Introducing an asynchronous signal into a digital {synchronized} system, using Flip-Flops.
The outcome is Intermittent or random failures during operation.
How to avoid metastability in ICs: Add an additional Flip Flop in the design to Synchronize the incoming
asynchronous signal with the new clock domain, which will reduce the Mean-Time-Between-Failure [MTBF].
Metastable: A state which exist between either "valid" digital logic state {an undefined voltage}
Digital Logic State: A defined range of voltages that indicate which logic level the device will switch to, or resides in.
For TTL, a logic low is {0 to .8 volts}, a logic high is {2.4 to 5 volts} [Logic Threshold Voltage Levels].
Undefined Voltage: A voltage between the established logic level, either High or Low; {.8 to 2.4 volts} from the example above.
Set-Up Time The time required for the input data signal at a flip flop to be valid before the incoming clock edge arrives .
Hold Time The time required for the input data signal to remain valid after the clock edge as transitioned.
Resolve Time: The amount of time the Flip Flop's output must return to a valid level before it's used.
This is 1/{clock frequency} - path delay. The output must be valid by the next clock, minus any chip or routing delay.
Path Delay = Tcko + Troute + Tsu;
.... Tcko = Clock to Output time of the flip flop,
.... Troute = Any trace delay between the the Q of the flip flop and the next device reading that data,
.... Tsu = any Set-Up time required by the next device reading the data.
Skew {Clock or data}: The change in time of one signal compared to another, caused by timing delays or
propagation delays. ~The timing differences developed by different devices performing the same function.
Ambiguity: The uncertainty in the amount of time it takes for a valid logic signal
to change from one state to another.
Metastability Window: The specific length of time, during which both the data
and clock should not occur. If both signals do occur, the output may go metastable.
Metastability Window
| Device | t(set-up) | t(hold) | t(total) |
| 74C74 | 100.0 | 0.0 | 100.0 |
| 74HC74 | 20.0 | 0.0 | 20.0 |
| 74HCT74 | 20.0 | 0.0 | 20.0 |
| 7474 | 20.0 | 5.0 | 25.0 |
| 74ALS74 | 15.0 | 10.0 | 25.0 |
| 74LS74 | 20.0 | 0.0 | 20.0 |
| 74S74 | 3.0 | 2.0 | 5.0 |
| 74LS74 | 4.5 | 0.0 | 4.5 |
| 74AC74 | 4.0 | 0.5 | 4.5 |
| 74ACT74 | 3.0 | 1.0 | 4.0 |
| 74ACTQ74 | 3.0 | 1.5 | 4.5 |
The Table above shows various Set-Up times and Hold times for a number different Logic families. The combination of the two values determine the width of the Metastability window. The larger the window, the greater the chance the device will go Metastable. In most cases newer logic families have smaller Metastability windows which reduce the chance of the device going Metastable.
Input Waveforms of Metastability.
A single stage Flip Flop [acting as a Synchronizer]. The absolute minimum a design should provide.
One stage may be enough, if the incoming data frequency is "slow", and the Flip Flop family is "fast".
If the chosen Flip Flop has time to resolve the metastable condition before the next clock tick, and
the output of the FF does not go to an asynchronous gate - the design may be solid.
The time between the two white lines in the diagram below defines the Metastability window.
The diagram above shows the flip flop clock and three possible times [zones] the data may arrive at the Flip Flop [FF]. Data 'Da' arrives and becomes stable before the clock edge. Data 'Db' arrives just before the clock edge violating the flip flops set-up time. data 'Dc' changes [or arrives after] the clock edge violating the hold time of the flip flop.
Output Waveforms of {Digital Logic Metastability Index}
Output waveforms due to signal timing Da, Db, Dc
'Da' produces a normal output, as the data does not violate the Set-up or Hold time of the device [in relation to the clock].
Either 'Db' or 'Dc' may produce a metastable output forcing the output to stay undefined for a longer amount of time,
increasing the propagation delay of the Flip Flop
Five possible conditions exist:
One: No timing violation occurred, and the output moves to the appropriate state (high or low).
Two: A timing violation does occur, and the output oscillates between the valid states (for a long time), or until its needed.
Third: A timing violation does occur, and the output moves to the wrong state.
Forth: A timing violation does occur, and the propagation delay is increased. Causing the next device in the chain to see the wrong value.
Fifth: A timing violation does occur, and no meta-stable behavior occurs. The output moves to the correct state with no oscillation or increase in propagation delay. However this condition is problematic because the gamble is taken each time the device is clock. This condition may persist for thousands of clock cycles, but may fail on the next clock cycle. For a fail-safe design stay in condition one, any other condition will result in failure.
Multi-Stage Synchronizer of Metastability.
Adding a second Flip Flop to the design will reduce the chance of the output going Metastable.
The output from the first flip flop may go valid, before the second flip flop is clocked. Adding yet another flip flop will reduce the probability that its output will be unstable even more. A 74AS4374 from TI provides a 'D' type, Dual stage synchronizer.
The table above details the difference in MTBF between a Single and Dual stage synchronizer.
Metastability Equations
To determine how often a Flip Flop will go to an undefined state, plug the data into one of these equations to calculate the MTBF.
Definitions
MTBF: Mean Time Between Failure
FD: Data Frequency
FC: Clock Frequency
TP: Flip Flop Propagation Delay
tr: Resolve Time
dt: Delay Time between Clocks [symbole delta t]
tsu: Device Setup Time
g: Flip FLop Resolution Time [symbol gama]
These are device dependent. Resolve time (among others) has to be looked up, via the data sheet (if it's provided).
As a rule: The faster the flip flop used, the better the MTBF for a given circuit.
The faster device families have lower Set-up and Hold times. This reduces the window of occurrence.
MTBF Examples of Metastability.
PLDs
Keep in mind that the table below is some what dated, I'm sure the newer FPGAs and PLD ICs have MTBF [Mean-Time-Between-Failure] numbers which far exceed the ones listed. Checking the Cypress site (8/05) I see that their faster version of a 22V10 IC is a dash five (5 nS).
| Device | fmax (MHz) | | | |
| PALC16R8-25 | 28.5 | 9.503 | 0.515 | 14.68 |
| PALC20G10-20 | 41.6 | 3.73 | 0.173 | 4.91 |
| PALC20RA10-15 | 33.3 | 2.86 | 0.216 | 5.87 |
| PALC22V10C-10 | 90.9 | 0.00808 | 0.547 | 13.0 |
| PALC22V10B-15 | 50.0 | 55.76 | 0.261 | 8.19 |
| PALC22V10-20 | 41.6 | 0.125 | 0.190 | 4.73 |
| CY7C330-66 | 66.6 | 1.02 | 0.290 | 8.12 |
| CY7C331-20 | 31.2 | 298.0 | 0.184 | 5.91 |
| CY7C332-15 | 47.6 | 1.55 | 0.337 | 9.35 |
| CY7C344-20 | 41.6 | 966.0 | 0.223 | 7.55 |
The Table data was copied from "Determine PLD metastability to derive ample MTBFs",
EDN August 5 1991, Author: Sean Dingman.