FlipFlop Introduction
FlipFlop Introduction
All sequential circuits contain combinational logic in addition to the memory elements.
We now consider the analysis and design of sequential circuits.
Sequential Circuits
Sequential circuits are those with memory, also called “feedback”. In this, they differ
from combinational circuits, which have no memory.
The stable output of a combinational circuit does not depend on the order in which its
inputs are changed. The stable output of a sequential circuit usually does depend
on the order in which the inputs are changed.
Sequential circuits can be used as memory elements; binary values can be stored in them.
The binary value stored in a circuit element is often called that element’s state.
All sequential circuits depend on a phenomenon called gate delay. This reflects the fact
that the output of any logic gate (implementing a Boolean function) does not change
immediately when the input changes, but only some time later.
The gate delay for modern circuits is typically a few nanoseconds.
Synchronous Sequential Circuits
We usually focus on clocked sequential circuits,
also called synchronous sequential circuits.
As the name “synchronous” implies, these circuits respond to a system clock,
which is used to synchronize the state changes of the various sequential circuits.
One textbook claims that “synchronous sequential circuits use clocks to order events.” A
better claim might be that the clock is used to coordinate events. Events that should
happen at the same time do; events that should happen later do happen later.
The system clock is a circuit that emits a sequence of regular pulses with a fixed and
reliable pulse rate. If you have an electronic watch (who doesn’t?), what you have is a
small electronic circuit emitting pulses and a counter circuit to count them.
Clock frequencies are measured in
kilohertz thousands of ticks per second
megahertz millions of ticks per second
gigahertz billions of ticks per second.
One can design asynchronous sequential circuits, which are not controlled by a system
clock. They present significant design challenges related to timing issues.
Views of the System Clock
There are a number of ways to view the system clock. In general, the view depends on
the detail that we need in discussing the problem. The logical view is shown in the next
figure, which illustrates some of the terms commonly used for a clock.
The sequence: the present state is Q(t), the clock “ticks”, the state is now Q(t + 1)
AGAIN: We call the next state Q(t + 1), even if the transition from Q(t) to
Q(t + 1) takes only a few nanoseconds. We are counting the actual
number of clock ticks, not the amount of time they take.
Latches and Flip–Flops: When Triggered
Clocked latches accept input when the system clock is at logic high.
Flip–flops accept input on either the rising edge of the system clock.
Advantages of Flip–Flops
When either a flip–flop or a latch is used as a part of a circuit, we have the problem of
feedback. In this, the output of the device is processed and then used as input.
Example: The flip–flop is a part of a register that is to be incremented.
We define the data path for the computer as following the output of the flip–flop
through the processing elements and back to the input of the flip–flop.
The data path time is the amount of time that it takes the data to travel the data path.
If this time is too short, the processed output of the flip–flop can get back to its input
during the time when the flip–flop remains sensitive to its input.
A flip–flop is a latch that has been modified to minimize the time during which the
device responds to its input.
This minimizes the possibility of uncontrolled feedback as associated instabilities.
Characteristic tables: Given Q(t), the present state of the flip–flop, and
the input, what will Q(t + 1), the next state of the flip–flop, be?
Excitation tables: Given Q(t), the present state of the flip–flop, and
Q(t + 1), the desired next state of the flip–flop,
what input is required to achieve that change.
Functional Definition of Flip–Flops
We use the characteristic table to describe both latches and flip–flops.
The characteristic table takes the present state and input and shows the next state.
Absent the explicit clock input, your instructor’s circuits might resemble unclocked
latches. Your instructor does not use such latches, but designs only with flip–flops.
SR Flip–Flop
We now adopt a functional view. How does the next state depend on the present state
and input. A flip–flop is a “bit holder”.
Here is the diagram for the SR flip–flop.
The characteristic table for the D flip–flop is so simple that it is expressed better as the
equation Q(t + 1) = D. Here is the table.
D Q(t + 1)
0 0
1 1
The excitation equation for a D flip–flop is quite simple: D = Q(t + 1).
The T Flip–Flop
The “toggle” flip–flop allows one to change the value stored. It is often used in circuits
in which the value of the bit changes between 0 and 1, as in a modulo–4 counter in which
the low–order bit goes 0, 1, 0, 1, 0, 1, etc.
The characteristic table for the T flip–flop is so simple that it is expressed better as the
equation Q(t + 1) = Q(t) T. Here is the table.
T Q(t + 1)
0 Q(t)
1 Q t
The excitation equation for a T flip–flop is also quite simple: T = Q(t) Q(t + 1).
Here the symbol “T” denotes the input; “t” and “t + 1” denote time.
The JK Flip–Flop as a General–Use Flip–Flop
The JK flip–flop can be used to implement any of the other three flip–flops.
As a D flip–flop
As a T flip–flop
The state transition table tells us what the required next state will be
for each present state.
Step 5 Separate the state transition table into P tables,
one for each flip-flop.
Here P = 2, so we need two tables.
Flip-Flop 1 Flip-Flop 0
Present State Next State Present State Next State
Y1 Y0 Y1( t+1 ) Y1 Y0 Y0( t+1 )
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 1
1 1 0 1 1 0
Each flip–flop is represented with the complete present state and its own next state.
Step 6 Decide on the types of flip-flops to use.
When in doubt, use all JK’s.
Our design will use JK flip–flops.
For design work, it is important that we remember the excitation table.
Here it is.
Q( t ) Q( t+1 ) J K
0 0 0 d
0 1 1 d
1 0 d 1
1 1 d 0
Step 7 Derive the input table for each flip-flop using the
excitation tables for the type.
Here is the table for flip–flop 1.
PS NS Input
Y1 Y0 Y1 J1 K1
00 0 0 d
01 1 1 d
10 1 d 0
11 0 d 1
2) If the column has both 0’s and 1’s in it, try to match it to a single variable,
which must be part of the present state. Only the 0’s and 1’s in a column
must match the suggested function.
4) If all the above fails, try for simple combinations of the present state.
NOTE: The use of the complement of a state in step 3 is due to the fact that
each flip–flop outputs both its state and the complement of its state.
Step 8 Derive the input equations for each flip-flop
Here is the input table for Flip–Flop 1
PS NS Input
Y1 Y0 Y1 J1 K1
00 0 0 d
01 1 1 d
10 1 d 0
11 0 d 1
J1 = Y0 K1 = Y0