All Topics  
Flip-flop (electronics)

 

   Email Print
   Bookmark   Link






 

Flip-flop (electronics)



 
 
In digital circuit
Digital circuit

Digital electronics are electronics systems that use digital signals. Digital electronics are representations of Boolean algebra and are used in computers, mobile phones, and other consumer products....
s, a flip-flop is a term referring to an electronic circuit
Electronic circuit

An electronic circuit is a closed path formed by the interconnection of electronic components through which an electric current can flow. The electronic circuits may be physically constructed using any number of methods....
 (a bistable multivibrator
Multivibrator

A multivibrator is an electronic circuit used to implement a variety of simple two-state systems such as oscillators, timers and flip-flop s. It is characterized by two amplifying devices cross-coupled by resistors and capacitors....
) that has two stable states and thereby is capable of serving as one bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 of memory
Computer storage

Computer data storage, often called storage or memory, refers to computer components, devices, and recording medium that retain digital data used for computing for some interval of time....
. Today, the term flip-flop has come to mostly denote non-transparent (clocked or edge-triggered) devices, while the simpler transparent ones are often referred to as latches; however, as this distinction is quite new, the two words are sometimes used interchangeably (see history).

A flip-flop is usually controlled by one or two control signals and/or a gate or clock signal
Clock signal

In electronics and especially Synchronous logic digital circuits, a clock signal is a Signalling used to coordinate the actions of two or more Electronic circuit....
.






Discussion
Ask a question about 'Flip-flop (electronics)'
Start a new discussion about 'Flip-flop (electronics)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In digital circuit
Digital circuit

Digital electronics are electronics systems that use digital signals. Digital electronics are representations of Boolean algebra and are used in computers, mobile phones, and other consumer products....
s, a flip-flop is a term referring to an electronic circuit
Electronic circuit

An electronic circuit is a closed path formed by the interconnection of electronic components through which an electric current can flow. The electronic circuits may be physically constructed using any number of methods....
 (a bistable multivibrator
Multivibrator

A multivibrator is an electronic circuit used to implement a variety of simple two-state systems such as oscillators, timers and flip-flop s. It is characterized by two amplifying devices cross-coupled by resistors and capacitors....
) that has two stable states and thereby is capable of serving as one bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 of memory
Computer storage

Computer data storage, often called storage or memory, refers to computer components, devices, and recording medium that retain digital data used for computing for some interval of time....
. Today, the term flip-flop has come to mostly denote non-transparent (clocked or edge-triggered) devices, while the simpler transparent ones are often referred to as latches; however, as this distinction is quite new, the two words are sometimes used interchangeably (see history).

A flip-flop is usually controlled by one or two control signals and/or a gate or clock signal
Clock signal

In electronics and especially Synchronous logic digital circuits, a clock signal is a Signalling used to coordinate the actions of two or more Electronic circuit....
. The output
Output

Output is the term denote either an exit or changes which exit a system and which activate/modify a process. It is an abstract concept, used in the model ing, system design and system exploitation....
 often includes the complement
Complement

In many different fields, the complement of X is something that together with X makes a complete whole, something that supplies what X lacks....
 as well as the normal output. As flip-flops are implemented electronically, they require power
Electric power

Electric power is defined as the rate at which electrical energy is transferred by an electric circuit. The SI unit of power is the watt .When electric current flows in a circuit, it can transfer energy to do mechanical work or work ....
 and ground
Ground (electricity)

In electrical engineering, ground or earth may be the reference point in an electrical circuit from which other voltages are measured, or a common return path for electric current, or a direct physical connection to the Earth....
 connections.

History


The first electronic flip-flop was invented in 1918 by William Eccles
William Eccles

William Henry Eccles was a United Kingdom physicist and a pioneer in the development of radio communication.He was born in Barrow-in-Furness, Lancashire, England....
 and F. W. Jordan
F. W. Jordan

Frank Wilfred Jordan was a British physicist who together with William Henry Eccles invented the so-called "Flip-flop "-circuit in 1918. This circuit became the basis of electronic memory in computers....
. It was initially called the Eccles–Jordan trigger circuit and consisted of two active elements (radio-tubes
Vacuum tube

In electronics, a vacuum tube, electron tube , thermionic valve, or just valve is a device used to amplifier, switch, otherwise modify, or create an Electricity signal by controlling the movement of electrons in a low-pressure space....
). The name flip-flop was later derived from the sound produced on a speaker connected to one of the back coupled amplifiers outputs during the trigger process within the circuit (as such, it may be considered a case of onomatopoeia
Onomatopoeia

Onomatopoeia is a word or a grouping of words that imitates the sound it is describing, such as animal noises like "oink" or "meow", or suggesting its source object, such as "boom", "zoom", "click", "bunk", "clang", "buzz", "zap", or "bang"....
). This original electronic flip-flop—a simple two-input bistable circuit without any dedicated clock (or even gate) signal, was transparent, and thus a device that would be labeled as a "latch" in many circles today.

Implementation


Flip-flops can be either simple (transparent) or clocked. Simple flip-flops can be built around a pair of cross-coupled inverting elements: vacuum tube
Vacuum tube

In electronics, a vacuum tube, electron tube , thermionic valve, or just valve is a device used to amplifier, switch, otherwise modify, or create an Electricity signal by controlling the movement of electrons in a low-pressure space....
s, bipolar transistors, field effect transistor
Field effect transistor

The field-effect transistor is a type of transistor that relies on an electric field to control the shape and hence the electrical conductivity of a channel of one type of charge carrier in a semiconductor material....
s, inverter
Inverter (logic gate)

In digital logic, an inverter or NOT gate is a logic gate which implements logical negation. The truth table is shown on the right.This represents perfect switching behavior, which is the defining assumption in Digital electronics....
s, and inverting logic gate
Logic gate

A logic gate performs a logical operation on one or more logic inputs and produces a single logic output. The logic normally performed is Boolean logic and is most commonly found in digital circuits....
s have all been used in practical circuits — perhaps augmented by some gating mechanism (an enable/disable input). The more advanced clocked (or non-transparent) devices are specially designed for synchronous (time-discrete) systems; such devices therefore ignore its inputs except at the transition of a dedicated clock signal (known as clocking, pulsing, or strobing). This causes the flip-flop to either change or retain its output signal based upon the values of the input signals at the transition. Some flip-flops change output on the rising edge of the clock, others on the falling edge.

Clocked flip-flops are typically implemented as master-slave devices where two basic flip-flops (plus some additional logic) collaborate to make it insensitive to spikes and noise between the short clock transitions; they nevertheless also often include asynchronous clear or set inputs which may be used to change the current output independent of the clock.

Flip-flops can be further divided into types that have found common applicability in both asynchronous and clocked sequential systems: the SR ("set-reset"), D ("data" or "delay"), T ("toggle"), and JK types are the common ones; all of which may be synthesized from (most) other types by a few logic gates. The behavior of a particular type can be described by what is termed the characteristic equation, which derives the "next" (i.e., after the next clock pulse) output, , in terms of the input signal(s) and/or the current output, .

Set-Reset flip-flops (SR flip-flops)


The fundamental latch is the simple SR flip-flop , where S and R stand for set and reset respectively. It can be constructed from a pair of cross-coupled NOR
NOR gate

The NOR gate is a digital logic gate that implements logical NOR - it behaves according to the truth table to the right. A HIGH output results if both the inputs to the gate are LOW ....
 logic gate
Logic gate

A logic gate performs a logical operation on one or more logic inputs and produces a single logic output. The logic normally performed is Boolean logic and is most commonly found in digital circuits....
s. The stored bit is present on the output marked Q.

Normally, in storage mode, the S and R inputs are both low
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
, and feedback
Feedback

Feedback describes the situation when output from an event or phenomenon in the past will influence the same event/phenomenon in the present or future....
 maintains the Q and Q outputs in a constant state, with Q the complement of Q. If S (Set) is pulsed high
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 while R is held low, then the Q output is forced high, and stays high even after S returns low; similarly, if R (Reset) is pulsed high while S is held low, then the Q output is forced low, and stays low even after R returns low.

SR Flip-Flop operation
Characteristic table
State transition table

In automata theory and sequential logic, a state transition table is a table showing what state a finite semiautomaton or finite state machine will move to, based on the current state and other inputs....
 
Excitation table
Excitation table

In electronics design, an excitation table shows the minimum inputs that are necessary to generate a particular next state when the current state is known....
SR Action Q(t) Q(t+1) SR Action
00 Keep state 000XNo change
01Q = 00110Set
10Q = 11001Reset
11Unstable combination,
see race condition
Race condition

A race condition or race hazard is a flaw in a system or process whereby the output and/or result of the process is unexpectedly and critically dependent on the sequence or timing of other events....
11X0No change
('X' denotes a Don't care condition; meaning the signal is irrelevant)

Toggle flip-flops (T flip-flops)


T Type Flip Flop
If the T input is high, the T flip-flop changes state ("toggles") whenever the clock input is strobed. If the T input is low, the flip-flop holds the previous value. This behavior is described by the characteristic equation
Equation

An equation is a mathematics Proposition, in table of mathematical symbols, that two things are exactly the same . Equations are written with an equal sign, as in...
:

(or, without benefit of the XOR
XOR gate

The XOR gate is a digital logic gate that implements exclusive disjunction - it behaves according to the truth table above. A HIGH output results if one, and only one, of the inputs to the gate is HIGH ....
 operator, the equivalent: )

and can be described in a truth table
Truth table

A truth table is a mathematical table used in logic?specifically in connection with Boolean algebra , boolean functions, and propositional calculus?to compute the functional values of logical expression s on each of their functional arguments, that is, on each combination of values taken by their logical variables....
:

T Flip-Flop operation
Characteristic table
State transition table

In automata theory and sequential logic, a state transition table is a table showing what state a finite semiautomaton or finite state machine will move to, based on the current state and other inputs....
 
Excitation table
Excitation table

In electronics design, an excitation table shows the minimum inputs that are necessary to generate a particular next state when the current state is known....
Comment Comment
0 0 0 hold state(no clk)000No change
0 1 1 hold state(no clk)110No change
1 0 1 toggle011Complement
1 1 0 toggle101Complement


When T is held high, the toggle flip-flop divides the clock frequency by two; that is, if clock frequency is 4 MHz, the output frequency obtained from the flip-flop will be 2 MHz. This 'divide by' feature has application in various types of digital counters. A T flip-flop can also be built using a JK flip-flop (J & K pins are connected together and act as T) or D flip-flop (T input and Qprevious is connected to the D input through an XOR gate).

JK flip-flop


The JK flip-flop augments the behavior of the SR flip-flop (J=Set, K=Reset) by interpreting the S = R = 1 condition as a "flip" or toggle command. Specifically, the combination J = 1, K = 0 is a command to set the flip-flop; the combination J = 0, K = 1 is a command to reset the flip-flop; and the combination J = K = 1 is a command to toggle the flip-flop, i.e., change its output to the logical complement of its current value. Setting J = K = 0 does NOT result in a D flip-flop, but rather, will hold the current state. To synthesize a D flip-flop, simply set K equal to the complement of J. The JK flip-flop is therefore a universal flip-flop, because it can be configured to work as an SR flip-flop, a D flip-flop, or a T flip-flop. NOTE: The flip flop is positive edge triggered (Clock Pulse) as seen in the timing diagram.
Jk Flip Flop
The characteristic equation of the JK flip-flop is:

and the corresponding truth table is:

JK Flip Flop operation
Characteristic table
State transition table

In automata theory and sequential logic, a state transition table is a table showing what state a finite semiautomaton or finite state machine will move to, based on the current state and other inputs....
 
Excitation table
Excitation table

In electronics design, an excitation table shows the minimum inputs that are necessary to generate a particular next state when the current state is known....
JKQnext Comment Q Qnext J KComment
0 0 hold state000XNo change
0 1 reset011XSet
1 0 set10X1Reset
1 1 toggle11X0No change


The origin of the name for the JK flip-flop is detailed by P. L. Lindley, a JPL engineer, in a letter to EDN, an electronics design magazine. The letter is dated June 13, 1968, and was published in the August edition of the newsletter. In the letter, Mr. Lindley explains that he heard the story of the JK flip-flop from Dr. Eldred Nelson, who is responsible for coining the term while working at Hughes Aircraft
Hughes Aircraft

Hughes Aircraft Company was a major aerospace and defense company founded by Howard Hughes. The group was based near Ballona Creek, in Culver City, California....
. Flip-flops in use at Hughes at the time were all of the type that came to be known as J-K. In designing a logical system, Dr. Nelson assigned letters to flip-flop inputs as follows: #1: A & B, #2: C & D, #3: E & F, #4: G & H, #5: J & K.

Another theory holds that the set and reset inputs were given the symbols "J" and "K" after one of the engineers that helped design the J-K flip-flop, Jack Kilby
Jack Kilby

Jack St. Clair Kilby was a Nobel Prize laureate in physics in 2000 for his invention of the integrated circuit in 1958 while working at Texas Instruments ....
.

D flip-flop


D Type Flip Flop
The Q output always takes on the state of the D input at the moment of a rising clock edge. (or falling edge if the clock input is active low) It is called the D flip-flop for this reason, since the output takes the value of the D input or Data input, and Delays it by one clock count. The D flip-flop can be interpreted as a primitive memory cell, zero-order hold
Zero-order hold

The zero-order hold is a mathematical model of the practical signal reconstruction done by a conventional digital-to-analog converter . That is, it describes the effect of converting a discrete-time signal to a continuous-time signal by holding each sample value for one sample interval....
, or delay line
Delay line

The term delay line has multiple meanings:* In electronics and derivative fields such as telecommunications, a delay line is a device where the input signal reaches the output of the device after a known period of time has elapsed....
.

Truth table:

ClockDQQprev
Rising edge00X
Rising edge11X
Non-RisingXQprev 
('X' denotes a Don't care
Don't Care

"Don't Care" is a 1994 Single by United States death metal band Obituary . It was released only in the USA, like a previous release of the album World Demise ....
 condition, meaning the signal is irrelevant)

These flip flops are very useful, as they form the basis for shift registers, which are an essential part of many electronic devices. The advantage of the D flip-flop over the D-type latch is that it "captures" the signal at the moment the clock goes high, and subsequent changes of the data line do not influence Q until the next rising clock edge. An exception is that some flip-flops have a 'reset' signal input, which will reset Q (to zero), and may be either asynchronous or synchronous with the clock.

The above circuit shifts the contents of the register to the right, one bit position on each active transition of the clock. The input X is shifted into the leftmost bit position.

Master-slave (pulse-triggered) D flip-flop


A master-slave D flip-flop is created by connecting two gated D latches in series, and inverting the enable input to one of them. It is called master-slave because the second latch in the series only changes in response to a change in the first (master) latch. The term pulse triggered means that data are entered on the rising edge of the clock pulse, but the output doesn't reflect the change until the falling edge of the clock pulse.

For a positive-edge triggered master-slave D flip-flop, when the clock signal is low (logical 0) the “enable” seen by the first or “master” D latch (the inverted clock signal) is high (logical 1). This allows the “master” latch to store the input value when the clock signal transitions from low to high. As the clock signal goes high (0 to 1) the inverted “enable” of the first latch goes low (1 to 0) and the value seen at the input to the master latch is “locked”. Nearly simultaneously, the twice inverted “enable” of the second or “slave” D latch transitions from low to high (0 to 1) with the clock signal. This allows the signal captured at the rising edge of the clock by the now “locked” master latch to pass through the “slave” latch. When the clock signal returns to low (1 to 0), the output of the "slave" latch is "locked", and the value seen at the last rising edge of the clock is held while the “master” latch begins to accept new values in preparation for the next rising clock edge.
D Type Flip Flop Diagram
By removing the left-most inverter in the above circuit, a D-type flip flop that strobes on the falling edge of a clock signal can be obtained. This has a truth table like this:

DQ>Qnext
0XFalling0
1XFalling1


Most D-type flip-flops in ICs have the capability to be set and reset, much like an SR flip-flop. Usually, the illegal S = R = 1 condition is resolved in D-type flip-flops.

InputsOutputs
SRD>QQ'
01XX01
10XX10
11XX11
By setting S = R = 0, the flip-flop can be used as described above.

Edge-triggered D flip-flop


A more efficient way to make a D flip-flop is not so easy to understand, but it works the same way. While the master-slave D flip flop is also triggered on the edge of a clock, its components are each triggered by clock levels. The "edge-triggered D flip flop" does not have the master slave properties.

Uses


  • A single flip-flop can be used to store one bit
    Bit

    A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
    , or binary digit, of data. See preset
    Default (computer science)

    A default, in computer science, refers to a setting or Value automatically assigned to a software application, computer program or Peripheral device, outside of user intervention....
    .
  • Any one of the flip-flop types can be used to build any of the others.
  • Many logic synthesis
    Logic synthesis

    Logic synthesis is a process by which an abstract form of desired circuit behavior is turned into a design implementation in terms of logic gates....
     tools will not use any other type than D flip-flop and D latch.
  • Level sensitive latches cause problems with Static Timing Analysis (STA) tools and Design For Test (DFT). Therefore,
their usage is often discouraged.
  • Many FPGA devices contain only edge-triggered D flip-flops
  • The data contained in several flip-flops may represent the state of a sequencer, the value of a counter
    Counter

    In digital logic and computing, a counter is a device which stores the number of times a particular event or Process has occurred, often in relationship to a clock signal....
    , an ASCII
    ASCII

    American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words....
     character in a computer's memory or any other piece of information.
  • One use is to build finite state machine
    Finite state machine

    A finite state machine or finite state automaton or simply a state machine, is a model of behavior composed of a finite number of state s, transitions between those states, and actions....
    s 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 constructing various types of counters. Repeated signals to the clock input will cause the flip-flop to change state once per high-to-low transition of the clock input, if its T input is "1". The output from one flip-flop can be fed to the clock 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. See: Counters
    • One of the problems with such a counter (called a ripple counter) is that the output is briefly invalid as the changes ripple through the logic. There are two solutions to this problem. The first is to sample the output only when it is known to be valid. The second, more widely used, is to use a different type of circuit called a synchronous counter. This uses more complex logic to ensure that the outputs of the counter all change at the same, predictable time. See: Counters
  • Frequency division
    Frequency divider

    A frequency divider is an electronic circuit that takes an input signal with a frequency, , and generates an output signal with a frequency:...
    : 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.


A flip-flop in combination with a Schmitt trigger
Schmitt trigger

In electronics, a Schmitt trigger is a comparator electrical network that incorporates positive feedback.When the input is higher than a certain chosen threshold, the output is high; when the input is below another chosen threshold, the output is low; when the input is between the two, the output retains its value....
 can be used for the implementation of an arbiter
Arbiter (electronics)

Arbiters are electronic devices that allocate access to shared resources....
 in asynchronous circuit
Asynchronous circuit

An asynchronous circuit is a electrical network in which the parts are largely autonomous. They are not governed by a clock circuit or global clock signal, but instead need only wait for the signals that indicate completion of instructions and operations....
s.

Clocked flip-flops are prone to a problem called metastability
Metastability in electronics

Metastability in electronics is the ability of a non-equilibrium electronic state to persist for a long period of time . Note this definition does not guarantee all of the properties that are sometimes demanded for a metastable state in statistical mechanics....
, 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. Theoretically it can take infinite time to settle down. In a computer
Computer

A computer is a machine that manipulates Data according to a list of Code .The first devices that resemble modern computers date to the mid-20th century , although the computer concept and various machines similar to computers existed earlier....
 system this can cause corruption of data or a program crash. The metastability in flip-flops can be avoided by ensuring that the data and control inputs are held valid and 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 picoseconds 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. The probability of metastability gets closer and closer to zero as the number of flip-flops connected in series is increased.

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 clock-to-output delay (common symbol in data sheets: tCO) or propagation delay
Propagation delay

NetworkingPropagation delay is defined as the amount of time it takes for a certain number of bytes to be transferred over a medium. Propagation delay is the distance between the two routers divided by the propagation speed....
 (tP), which is the time the flip-flop takes to change its output after the clock edge. The time for a high-to-low transition (tPHL) is sometimes different from the time for a low-to-high transition (tPLH).

When connecting flip-flops in a chain, it is important to ensure that the tCO of the first flip-flop is longer than the hold time (tH) of the second flip-flop, otherwise the second flip-flop will not receive the data reliably. The relationship between tCO and tH is normally guaranteed if both flip-flops are of the same type.

Flip-flop integrated circuits


Integrated circuit
Integrated circuit

In electronics, an integrated circuit is a miniaturized electronic circuit that has been manufactured in the surface of a thin Wafer of semiconductor material....
 (ICs) exist that provide one or more flip-flops. For example, the 7473 Dual JK Master-Slave Flip-flop or the 74374, an octal D Flip-flop, in the 7400 series
7400 series

The 7400 series of Transistor-transistor logic integrated circuits are historically important as the first widespread logic family of TTL integrated circuit logic ....
.

See also


  • Monostable
  • Astable
  • Pulse transition detector
    Pulse transition detector

    A Pulse transition detector is used in flip flops in order to achieve edge triggering in the circuit. It merely converts the clocks rising edge to a very narrow pulse....
  • Deadlock
    Deadlock

    A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does. It is often seen in a paradox like 'the chicken or the egg'....