
In
electronics
Electronics is a scientific and engineering discipline that studies and applies the principles of physics to design, create, and operate devices that manipulate electrons and other Electric charge, electrically charged particles. It is a subfield ...
, metastability is the ability of a
digital electronic
Digital electronics is a field of electronics involving the study of digital signals and the engineering of devices that use or produce them. It deals with the relationship between binary inputs and outputs by passing electrical signals through ...
system to persist for an unbounded time in an
unstable equilibrium or
metastable
In chemistry and physics, metastability is an intermediate energetic state within a dynamical system other than the system's state of least energy.
A ball resting in a hollow on a slope is a simple example of metastability. If the ball is onl ...
state.
In
digital logic
A logic gate is a device that performs a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic gate, one that has, for ...
circuits, a
digital signal
A digital signal is a signal that represents data as a sequence of discrete values; at any given time it can only take on, at most, one of a finite number of values. This contrasts with an analog signal, which represents continuous values; ...
is required to be within certain
voltage
Voltage, also known as (electrical) potential difference, electric pressure, or electric tension, is the difference in electric potential between two points. In a Electrostatics, static electric field, it corresponds to the Work (electrical), ...
or
current limits to represent a '0' or '1'
logic level
In digital circuits, a logic level is one of a finite number of states that a digital signal can inhabit. Logic levels are usually represented by the voltage difference between the signal and ground, although other standards exist. The range of ...
for correct circuit operation; if the signal is within a forbidden intermediate range it may cause faulty behavior in logic gates the signal is applied to. In metastable states, the circuit may be unable to settle into a stable '0' or '1' logic level within the time required for proper circuit operation. As a result, the circuit can act in unpredictable ways, and may lead to a system failure, sometimes referred to as a "glitch". Metastability is an instance of the
Buridan's ass paradox.
Metastable states are inherent features of
asynchronous digital systems, and of systems with more than one independent
clock
A clock or chronometer is a device that measures and displays time. The clock is one of the oldest Invention, human inventions, meeting the need to measure intervals of time shorter than the natural units such as the day, the lunar month, a ...
domain. In
self-timed asynchronous systems, arbiters are designed to allow the system to proceed only after the metastability has resolved, so the metastability is a normal condition, not an error condition.
[
]
In synchronous systems with asynchronous inputs, synchronizers are designed to make the probability of a synchronization failure acceptably small.
Metastable states are avoidable in fully synchronous systems when the input
setup and hold time requirements on flip-flops are satisfied.
Example

A simple example of metastability can be found in an
SR NOR latch, when Set and Reset inputs are true (R=1 and S=1) and then both transition to false (R=0 and S=0) at about the same time. Both outputs Q and are initially held at 0 by the simultaneous Set and Reset inputs. After both Set and Reset inputs change to false, the flip-flop will (eventually) end up in one of two stable states, one of Q and true and the other false. The final state will depend on which of R or S returns to zero first, chronologically, but if both transition at about the same time, the resulting metastability, with intermediate or oscillatory output levels, can take arbitrarily long to resolve to a stable state.
Arbiters
In electronics, an ''arbiter'' is a circuit designed to determine which of several signals arrive first. Arbiters are used in asynchronous circuits to order computational activities for shared resources to prevent concurrent incorrect operations. Arbiters are used on the inputs of fully synchronous systems, and also between clock domains, as synchronizers for input signals. Although they can minimize the occurrence of metastability to very low probabilities, all arbiters nevertheless have metastable states,
which are unavoidable at the boundaries of regions of the input
state space
In computer science, a state space is a discrete space representing the set of all possible configurations of a system. It is a useful abstraction for reasoning about the behavior of a given system and is widely used in the fields of artificial ...
resulting in different outputs.
Synchronous circuits
Synchronous circuit
In digital electronics, a synchronous circuit is a digital circuit in which the changes in the state (computer science), state of memory elements are synchronized by a clock signal. In a sequential logic, sequential digital logic circuit, data ...
design techniques make digital circuits that are resistant to the failure modes that can be caused by metastability. A clock domain is defined as a group of flip-flops with a common clock. Such architectures can form a circuit guaranteed free of metastability (below a certain maximum clock frequency, above which first metastability, then outright failure occur), assuming a low-
skew common clock. However, even then, if the system has a dependence on any continuous inputs then these are likely to be vulnerable to metastable states.
Synchronizer circuits are used to reduce the likelihood of metastability when receiving an asynchronous input or when transferring signals between different clock domains. Synchronizers may take the form of a cascade of
D flip-flops (e.g. the
shift register
A shift register is a type of digital circuit using a cascade of flip-flop (electronics), flip-flops where the output of one flip-flop is connected to the input of the next. They share a single clock signal, which causes the data stored in the syst ...
in Figure 3). Although each flip-flop stage adds an additional clock cycle of
latency to the input data stream, each stage provides an opportunity to resolve metastability. Such synchronizers can be engineered to reduce metastability to a tolerable rate.
Schmitt triggers can also be used to reduce the likelihood of metastability, but as the researcher Chaney demonstrated in 1979, even Schmitt triggers may become metastable. He further argued that it is not possible to entirely remove the possibility of metastability from unsynchronized inputs within finite time and that "there is a great deal of theoretical and experimental evidence that a region of anomalous behavior exists for every device that has two stable states." In the face of this inevitability, hardware can only reduce the probability of metastability, and systems can try to gracefully handle the occasional metastable event.
Failure modes
Although metastability is well understood and architectural techniques to control it are known, it persists as a
failure mode
Failure causes are defects in design, process, quality, or part application, which are the underlying cause of a failure or which initiate a process which leads to failure. Where failure depends on the user of the product or process, then human er ...
in equipment.
Serious computer and
digital hardware
Digital electronics is a field of electronics involving the study of digital signals and the engineering of devices that use or produce them. It deals with the relationship between binary inputs and outputs by passing electrical signals through ...
bugs caused by metastability have a fascinating social history. Many engineers have refused to believe that a
bistable device can enter into a state that is neither ''true'' nor ''false'' and has a positive probability that it will remain indefinite for any given period of time, albeit with exponentially decreasing probability over time.
[, p. 4-6][, p. 196, 200, eq. 6-29][, p. 4-5, eq. 1-1] However, metastability is an inevitable result of any attempt to map a continuous domain to a discrete one. At the boundaries in the continuous domain between regions which map to different discrete outputs, points arbitrarily close together in the continuous domain map to different outputs, making a decision as to which output to select a difficult and potentially lengthy process.
If the inputs to an arbiter or flip-flop arrive almost simultaneously, the circuit most likely will traverse a point of metastability. Metastability remains poorly understood in some circles, and various engineers have proposed their own circuits said to solve or filter out the metastability; typically these circuits simply shift the occurrence of metastability from one place to another.
[Ran Ginosar.]
Fourteen Ways to Fool Your Synchronizer
ASYNC 2003. Chips using multiple clock sources are often tested with tester clocks that have fixed phase relationships, not the independent clocks drifting past each other that will be experienced during operation. This usually explicitly prevents the metastable failure mode that will occur in the field from being seen or reported. Proper testing for metastability frequently employs clocks of slightly different frequencies and ensuring correct circuit operation.
See also
*
Analog-to-digital converter
In electronics, an analog-to-digital converter (ADC, A/D, or A-to-D) is a system that converts an analog signal, such as a sound picked up by a microphone or light entering a digital camera, into a Digital signal (signal processing), digi ...
*
Buridan's ass
*
Asynchronous CPU
Asynchronous circuit (clockless or self-timed circuit) is a sequential digital logic circuit that does not use a global clock circuit or signal generator to synchronize its components. Instead, the components are driven by a handshaking ci ...
*
Ground bounce
*
Tri-state logic
In digital electronics, a tri-state or three-state buffer is a type of digital buffer that has three stable states: a high voltage output state (logical 1), a low output state (logical 0), and a high-impedance (Hi-Z) state. In the Hi-Z state, th ...
References
External links
Metastability Performance of Clocked FIFOsThe 'Asynchronous' BibliographyAsynchronous Logic*
ttp://www.fpga-faq.org/FAQ_Pages/0017_Tell_me_about_metastables.htm Detailed explanations and Synchronizer designsMetastability BibliographyClock Domain Crossing: Closing the Loop on Clock Domain Functional Implementation Problems Cadence Design Systems
* Stephenson, Jennifer
Understanding Metastability in FPGAs Altera Corporation white paper. July 2009.
* Bahukhandi, Ashirwad. Metastability. Lecture Notes for Advanced Logic Design and Switching Theory. January 2002.
* Cummings, Clifford E
Synthesis and Scripting Techniques for Designing Multi-Asynchronous Clock Designs SNUG 2001.
* Haseloff, Eilhard
Metastable Response in 5-V Logic Circuits Texas Instruments Report. February 1997.
* Nystrom, Mika, and Alain J. Martin
Crossing the Synchronous Asynchronous Divide WCED 2002.
*Patil, Girish, IFV Division, Cadence Design Systems. Clock Synchronization Issues and Static Verification Techniques. Cadence Technical Conference 2004.
Smith, Michael John Sebastian. Application-Specific Integrated Circuits.Addison Wesley Longman, 1997, Chapter 6.4.1.
* Stein, Mike
Crossing the abyss: asynchronous signals in a synchronous worldEDN design feature. July 24, 2003.
* Cox, Jerome R. and Engel, George L., Blendics, Inc. White Pape
"Metastability and Fatal System Errors"] Nov. 2010
* Adam Taylor
"Wrapping One's Brain Around Metastability" EE Times, 2013-11-20
{{DEFAULTSORT:Metastability In Electronics
Electrical engineering
Digital electronics