 Flip-flops and Latches

A flip-flop is a semiconductor device that has a digital output which can be toggled between two stable states by providing it with the appropriate digital input signals. Once the output is put in one state, it remains there until a change in the inputs causes it to toggle again. This toggling between two logic states is also referred to as 'flip-flopping.'

There are several types of flip-flops, the common ones of which are described in the following paragraphs.

The Set-Reset (S-R) Flip-flop

The Set-Reset (SR) flip-flop refers to a flip-flop that obeys the truth table shown in Table 1.  It has two inputs, namely, a Set input, or S,  and a Reset input, or R. It also has two outputs, the main output Q and its complement Q.

 S R QN+1 QN+1 0 0 QN QN 0 1 0 1 1 0 1 0 1 1 Not Used

Table 1. The S-R Flip-flop Truth Table

A simple representation of an S-R flip-flop is a pair of cross-coupled NOR gates, i.e., the output of one gate is tied to one of the two inputs of the other gate and vice versa.  The free input of one NOR gate is used as R while the free input of the other gate is used as S.

The output of the gate with the 'R' input is used as the Q output while the output of the gate with the 'S' input is used as the Q output.  Thus, resetting an S-R flip-flop's output Q to '0' requires R=1 and S=0, while setting Q to '1' requires S=1 and R=0.

In real-world applications, flip-flops are 'clocked' so that one can control the exact moment at which the output changes its state in response to changes in inputs.  The clock digital input of clocked flip-flops is usually denoted as C.

The JK Flip-flop

The JK flip-flop is a flip-flop that obeys the truth table in Table 2.  The J-K flip-flop differs from the S-R flip-flop in the sense that its next output is determined by its present output state as well, aside from the states of its inputs.

Note that in the J-K flip-flop, the S input is now called the J input and the R input is now called the K input.  Thus, in a JK flip-flop, the output will not change if both J and K are '0', but will toggle to its complement if both inputs are '1'.

 J K QN+1 0 0 QN 0 1 0 1 0 1 1 1 QN

Table 2. The J-K Flip-flop Truth Table

The D-Type Flip-flop

The D-type flip-flop is just a clocked flip-flop with a single digital input D. Every time a D-type flip-flop is clocked, its output follows whatever the state of D is.

A flip-flop may be used to store or 'lock' one bit of information.  This locking of information is also known as 'latching', so a flip-flop may be referred to as a single-bit latch.

There now exist many digital IC's consisting of a set of several flip-flops, whose main function is to latch several bits of data.  These IC's are known as 'latches', and are used to capture data from the data bus of a digital system at precise moments in time.  In fact, simple computer-controlled circuits use latches as I/O devices.  The flip-flop is also the basic building block of SRAM's.