|
|
See also: monostable multivibrator, astable multivibrator.
The first electronic flip-flop was invented in 1919 by W. H. Eccles and F. W. Jordan. It was initially called the Eccles-Jordan trigger circuit.
| Table of contents |
|
2 Use 3 Timing and Metastability 4 External links |
Types of flip-flops
T flip-flop
One way of changing the state is to have the flip-flop's state invert when a clock signal changes state. Usually they change only when the clock moves in a particular direction, e.g. low (ground) to high (for example 5 volts). This is called a T-type (for "toggle") flip-flop.
Several T flip-flops can be connected together to form a divide by N counter.
Characteristic equation:
The outputs of a basic S-R flip-flop change whenever its R or S inputs change appropriately. A clocked S-R flip-flop has an extra clock input which enables or disables the other two inputs. When they are disabled the outputs remain constant.
If one connects two clocked S-R flip-flops so that the Q and /Q outputs of the first (or "master") flip-flop drive the S and R inputs of the second (or "slave") flip-flop, and the slave's clock input is driven with an inverted version of the master's clock, then this is an edge-triggered R-S flip-flop. The external R and S inputs of this device are latched on one edge (transition) of the clock (e.g. the falling edge) and the outputs will only change on the next opposite (rising) edge.
If both R and S inputs are active (when enabled), a race condition occurs and the outputs will be in an indeterminate state. A J-K flip-flop avoids this possibility.
A J-K flip-flop operates as follows:
Characteristic equation: Qnext = D
One use is to build finite state machines from electronic logic. The flip-flops remember the machine's previous state, and digital logic uses that state to calculate the next state.
The "T" flip-flop is useful for counting. Repeated signals to the clock input will cause the flip-flop to change state once per high-to-low transition of the clock input. The output from one flip-flop can be fed to the input of a second and so on. The final output of the circuit, considered as the array of outputs of all the individual flip-flops, is a count, in binary, of the number of cycles of the first clock input, up to a maximum of 2n-1, where n is the number of flip-flops used.
One of the problems with such a counter is that the output is briefly invalid as the changes ripple through the logic. To solve this problem, there are circuits called "synchronous counters". These use more logic to assure that the outputs of the counter all change at the same, predictable time.
Frequency division: a chain of "T" flip-flops as described above will also function to divide an input in frequency by 2n, where n is the number of flip-flops used between the input and the output.
Registerss to store numbers in computers. A "D" flip-flop can represent one digit of a binary number. The computer's control unit puts out the clock signal at the right time to capture the data.
In many cases, metastability in flip-flops can be avoided by ensuring that the data and control inputs are held constant for specified periods before and after the clock pulse, called the setup time (tsu) and the hold time (th) respectively. These times are specified in the data sheet for the device, and are typically between a few nanoseconds and a few hundred nanoseconds for modern devices.
Unfortunately, it is not always possible to meet the setup and hold criteria, because the flip-flop may be connected to a real-time signal that could change at any time, outside the control of the designer. In this case, the best the designer can do is to reduce the probability of error to a certain level, depending on the required reliability of the circuit. One technique for suppressing metastability is to connect two or more flip-flops in a chain, so that the output of each one feeds the data input of the next, and all devices share a common clock. With this method, the probability of a metastable event can be reduced to a negligible value, but never to zero.
So-called metastable-hardened flip-flops are available, which work by reducing the setup and hold times as much as possible, but even these cannot eliminate the problem entirely. This is because metastability is more than simply a matter of circuit design. When the transitions in the clock and the data are close together in time, the flip-flop is forced to decide which event happened first. However fast we make the device, there is always the possibility that the input events will be so close together that it cannot detect which one happened first. It is therefore logically impossible to build a perfectly metastable-proof flip-flop.
Another important timing value for a flip-flop is the propagation delay (common symbol in data sheets: tprop). It is the time the flip-flop takes before its output changes after the clock edge. The propagation delay may be different for the high-to-low and the low-to-high transitions. Data sheet symbols are tPHL and tPLH respectively.
In footwear and fashion, flip flops are a kind of loose sandal that characteristically "flips" and "flops" as the wearer walks.
S-R flip-flop
A "set/reset" flip-flop in which activating the "set" ("S") input will switch it to one stable state and activating the "reset" ("R") input will switch it to the other state.J-K flip-flop
A third type of flip-flop is composed of a pair of S-R flip-flops connected in series as a Master and Slave. The Master section receives the inputs and is gated by a clock while the Slave section is gated by an inversion of that clock. The Slave's outputs are cross-coupled back to the input gates of the Master as well as being the outputs. This is called an J-K flip-flop. By connecting its J and K inputs in various different ways this versatile flip-flop could be configured to toggle, store data, and perform many other functions.
Characteristic equation: D flip-flop
A fourth type records an input's state (the data) when a clock is pulsed. This is called a D-type (for "data") flip-flop.
Use
The flip-flop can be used to store one bit, or binary digit, of data. The data may represent the state of a sequencer, the value of a counter, an ASCII character in a computer's memory or any other piece of information.Timing and Metastability
Clocked flip-flops are prone to a problem called metastability, which happens when a data or control input is changing at the instant of the clock pulse. The result is that the output may behave unpredictably, taking many times longer than normal to settle to its correct state, or even oscillating several times before settling. In a computer system this can cause corruption of data or a program crash.External links