Beruflich Dokumente
Kultur Dokumente
Flip-flops are synchronous bistable devices. The term synchronous means the output changes state
only when the clock input is triggered. That is, changes in the output occur in synchronization with
the clock.
Flip-flop is a kind of multivibrator. There are three types of multivibrators:
1.
2.
3.
Monostable multivibrator (also called one-shot) has only one stable state. It produces a single pulse in response to a
triggering input.
Bistable multivibrator exhibits two stable states. It is able to retain the two SET and RESET states indefinitely. It is
commonly used as a basic building block for counters, registers and memories.
Astable multivibrator has no stable state at all. It is used primarily as an oscillator to generate periodic pulse waveforms
for timing purposes.
In this tutorial, the three basic categories of bistable elements are emphasized: edge-triggered
flip-flop, pulse-triggered (master-slave) flip-flop, and data lock-out flip-flop. Their operating
characteristics and basic applications will also be discussed.
Edge-Triggered Flip-flops
An edge-triggered flip-flop changes states either at the positive edge (rising edge) or at the negative edge (falling edge) of the clock
pulse on the control input. The three basic types are introduced here: S-R, J-K and D.
The S-R, J-K and D inputs are called synchronous inputs because data on these inputs are transferred to the flip-flop's output only
on the triggering edge of the clock pulse.On the other hand, the direct set (SET) and clear (CLR) inputs are called asynchronous
inputs, as they are inputs that affect the state of the flip-flop independent of the clock. For the synchronous operations to work
properly, these asynchronous inputs must both be kept LOW.
Edge-triggered S-R flip-flop
The basic operation is illustrated below, along with the truth table for this type of flip-flop. The
operation and truth table for a negative edge-triggered flip-flop are the same as those for a
positive except that the falling edge of the clock pulse is the triggering edge.
Edge-triggered D flip-flop
The operations of a D flip-flop is much more simpler. It has only one input addition to the clock. It is very useful when a single data
bit (0 or 1) is to be stored. If there is a HIGH on the D input when a clock pulse is applied, the flip-flop SETs and stores a 1. If there
is a LOW on the D input when a clock pulse is applied, the flip-flop RESETs and stores a 0. The truth table below summarize the
operations of the positive edge-triggered D flip-flop. As before, the negative edge-triggered flip-flop works the same except that the
falling edge of the clock pulse is the triggering edge.
The truth tables for the above pulse-triggered flip-flops are all the same as that for the edge-triggered flip-flops, except for the way
they are clocked. These flip-flops are also called Master-Slave flip-flops simply because their internal construction are divided into
two sections. The slave section is basically the same as the master section except that it is clocked on the inverted clock pulse and is
controlled by the outputs of the master section rather than by the external inputs. The logic diagram for a basic master-slave S-R
flip-flop is shown below.
Again, the above data lock-out flip-flops have same the truth tables as that for the edge-triggered flip-flops, except for the way they
are clocked.
Operating Characteristics
The operating characteristics mention here apply to all flip-flops regardless of the particular form of the circuit. They are typically
found in data sheets for integrated circuits. They specify the performance, operating requirements, and operating limitations of the
circuit.
Propagation Delay Time - is the interval of time required after an input signal has been applied for the resulting output change to
occur.
Set-Up Time - is the minimum interval required for the logic levels to be maintained constantly on
the inputs (J and K, or S and R, or D) prior to the triggering edge of the clock pulse in order for the
levels to be reliably clocked into the flip-flop.
Hold Time - is the minimum interval required for the logic levels to remain on the inputs after the
triggering edge of the clock pulse in order for the levels to be reliably clocked into the flip-flop.
Maximum Clock Frequency - is the highest rate that a flip-flop can be reliably triggered.
Power Dissipation - is the total power consumption of the device.
Pulse Widths - are the minimum pulse widths specified by the manufacturer for the Clock, SET and
CLEAR inputs.
Applications
Frequency Division
When a pulse waveform is applied to the clock input of a J-K flip-flop that is connected to toggle, the Q output is a square wave with
half the frequency of the clock input. If more flip-flops are connected together as shown in the figure below, further division of the
clock frequency can be achieved.
The Q output of the second flip-flop is one-fourth the frequency of the original clock input. This is because the frequency of the
clock is divided by 2 by the first flip-flop, then divided by 2 again by the second flip-flop. If more flip-flops are connected this way,
the frequency division would be 2 to the power n, where n is the number of flip-flops.
Each of the three parallel data lines is connected to the D input of a flip-flop. Since all the clock inputs are
connected to the same clock, the data on the D inputs are stored simultaneously by the flip-flops on the
positive edge of the clock. Registers, a group of flip-flops use for data storage, will be explained in more
detail in a later chapter.
Counting
Table of Contents
Introduction
Asynchronous (Ripple) Counters
Asynchronous Decade Counters
Asynchronous Up-Down Counters
Synchronous Counters
Synchronous Decade Counters
Synchronous Up-Down Counters
Applications
Introduction
Circuits for counting events are frequently used in computers and other digital systems. Since a
counter circuit must remember its past states, it has to possess memory. The chapter about flipflops introduced how flip-flops are connected to make a counter. The number of flip-flops used and
how they are connected determine the number of states and the sequence of the states that the
counter goes through in each complete cycle.
Counters can be classified into two broad categories according to the way they are clocked:
1.
2.
Asynchronous (Ripple) Counters - the first flip-flop is clocked by the external clock pulse,
and then each successive flip-flop is clocked by the Q or Q' output of the previous flip-flop.
Synchronous Counters - all memory elements are simultaneously triggered by the same
clock.
In this tutorial, pure binary, decade and up-down counters within the two categories will be
introduced.
Asynchronous
(Ripple) Counters
Note that for simplicity, the transitions of Q0, Q1 and CLK in the timing diagram above are shown as simultaneous even though this
is an asynchronous counter. Actually, there is some small delay between the CLK, Q0 and Q1 transitions.
Usually, all the CLEAR inputs are connected together, so that a single pulse can clear all the flipflops before counting starts. The clock pulse fed into FF0 is rippled through the other counters
after propagation delays, like a ripple on water, hence the name Ripple Counter.
The 2-bit ripple counter circuit above has four different states, each one corresponding to a count
value. Similarly, a counter with n flip-flops can have 2 to the power n states. The number of states
in a counter is known as its mod (modulo) number. Thus a 2-bit counter is a mod-4 counter.
A mod-n counter may also described as a divide-by-n counter. This is because the most significant
flip-flop (the furthest flip-flop from the original clock pulse) produces one pulse for every n pulses
at the clock input of the least significant flip-flop (the one triggers by the clock pulse). Thus, the
above counter is an example of a divide-by-4 counter.
Asynchronous
Decade Counters
The binary counters previously introduced have two to the power n states. But counters with states less than this number are also
possible. They are designed to have the number of states in their sequences, which are called truncated sequences. These sequences
are achieved by forcing the counter to recycle before going through all of its normal states.
A common modulus for counters with truncated sequences is ten. A counter with ten states in its
sequence is called a decade counter. The circuit below is an implementation of a decade counter.
Once the counter counts to ten (1010), all the flip-flops are being cleared. Notice that only Q1 and Q3 are used to decode the count of
ten. This is called partial decoding, as none of the other states (zero to nine) have both Q1 and Q3 HIGH at the same time.
The sequence of the decade counter is shown in the table below:
Asynchronous
Up-Down Counters
In certain applications a counter must be able to count both up and down. The circuit below is a 3-bit up-down counter. It counts
up or down depending on the status of the control signals UP and DOWN. When the UP input is at 1 and the DOWN input is at 0,
the NAND network between FF0 and FF1 will gate the non-inverted output (Q) of FF0 into the clock input of FF1. Similarly, Q of
FF1 will be gated through the other NAND network into the clock input of FF2. Thus the counter will count up.
When the control input UP is at 0 and DOWN is at 1, the inverted outputs of FF0 and FF1 are gated
into the clock inputs of FF1 and FF2 respectively. If the flip-flops are initially reset to 0's, then the
counter will go through the following sequence as input pulses are applied.
Notice that an asynchronous up-down counter is slower than an up counter or a down counter because of
the additional propagation delay introduced by the NAND networks.
Synchronous Counters
In synchronous counters, the clock inputs of all the flip-flops are connected together and are triggered by the input pulses. Thus, all
the flip-flops change state simultaneously (in parallel). The circuit below is a 3-bit synchronous counter. The J and K inputs of FF0
are connected to HIGH. FF1 has its J and K inputs connected to the output of FF0, and the J and K inputs of FF2 are connected to
the output of an AND gate that is fed by the outputs of FF0 and FF1.
Pay attention to what happens after the 3rd clock pulse. Both outputs of FF0 and FF1 are HIGH.
The positive edge of the 4th clock pulse will cause FF2 to change its state due to the AND gate.
The count sequence for the 3-bit counter is shown on the right.
The most important advantage of synchronous counters is that there is no cumulative
time delay because all flip-flops are triggered in parallel. Thus, the maximum operating
frequency for this counter will be significantly higher than for the corresponding ripple
counter.
Synchronous
Decade Counters
Similar to an asynchronous decade counter, a synchronous decade counter counts from 0 to 9 and then recycles to 0 again. This is
done by forcing the 1010 state back to the 0000 state. This so called truncated sequence can be constructed by the following circuit.
Q3 changes on the next clock pulse each time Q0=1, Q1=1 and Q2=1 (count 7),
or when Q0=1 and Q3=1 (count 9).
These characteristics are implemented with the AND/OR logic connected as shown in the logic diagram above.
Synchronous
Up-Down Counters
A circuit of a 3-bit synchronous up-down counter and a table of its sequence are shown below. Similar to an asynchronous up-down
counter, a synchronous up-down counter also has an up-down control input. It is used to control the direction of the counter through
a certain sequence.
for both the UP and DOWN sequences, Q0 toggles on each clock pulse.
for the UP sequence, Q1 changes state on the next clock pulse when Q0=1.
for the DOWN sequence, Q1 changes state on the next clock pulse when Q0=0.
for the UP sequence, Q2 changes state on the next clock pulse when Q0=Q1=1.
for the DOWN sequence, Q2 changes state on the next clock pulse when Q0=Q1=0.
These characteristics are implemented with the AND, OR & NOT logic connected as shown in the logic diagram above.
Applications
Digital counters are very useful in many applications. They can be easily found in digital clocks and parallel-to-serial data
conversion (multiplexing). In this section, we will use the later as an example on how counters are being used.
A group of bits appearing simultaneously on parallel lines is called parallel data. A group of bits
appearing on a single line in a time sequence is called serial data. Parallel-to-serial conversion is
normally accomplished by the use of a counter to provide a binary sequence for the data-select
inputs of a multiplexer, as illustrated in the circuit below.
The Q outputs of the modulus-8 counter are connected to the data-select inputs of
an eight-bit multiplexer. The first byte (eight-bit group) of parallel data is applied
to the multiplexer inputs. As the counter goes through a binary sequence from 0 to
7, each bit beginning with D0, is sequentially selected and passed through the
multiplexer to the output line.
After eight clock pulses, the data byte has been converted to a serial format and
sent out on the transmission line. Then, the counter recycles back to 0 and converts
another parallel byte sequentially again by the same process.
Table of Contents
Introduction
Serial In - Serial Out Shift Registers
Serial In - Parallel Out Shift Registers
Parallel In - Serial Out Shift Registers
Parallel In - Parallel Out Shift Registers
Bidirectional Shift Registers
Shift Register Counters
Applications
Introduction
Shift registers are a type of sequential logic circuit, mainly for storage of digital data. They are a group of flip-flops connected in a
chain so that the output from one flip-flop becomes the input of the next flip-flop. Most of the registers possess no characteristic
internal sequence of states. All the flip-flops are driven by a common clock, and all are set or reset simultaneously.
In this chapter, the basic types of shift registers are studied, such as Serial In - Serial Out, Serial In
- Parallel Out, Parallel In - Serial Out, Parallel In - Parallel Out, and bidirectional shift registers. A
special form of counter - the shift register counter, is also introduced.
Serial In - Serial Out
Shift Registers
A basic four-bit shift register can be constructed using four D flip-flops, as shown below. The operation of the circuit is as follows.
The register is first cleared, forcing all four outputs to zero. The input data is then applied sequentially to the D input of the first
flip-flop on the left (FF0). During each clock pulse, one bit is transmitted from left to right. Assume a data word to be 1001. The
least significant bit of the data has to be shifted through the register from FF0 to FF3.
In order to get the data out of the register, they must be shifted out serially. This can be done
destructively or non-destructively. For destructive readout, the original data is lost and at the end
of the read cycle, all flip-flops are reset to zero.
To avoid the loss of data, an arrangement for a non-destructive reading can be done by adding two AND gates, an OR gate and an
inverter to the system. The construction of this circuit is shown below.
The data is loaded to the register when the control line is HIGH (ie WRITE). The data can be shifted out of the register when the
control line is LOW (ie READ). This is shown in the animation below.
In the animation below, we can see how the four-bit binary number 1001 is shifted to the Q outputs of the register.
D0, D1, D2 and D3 are the parallel inputs, where D0 is the most significant bit and D3 is the least significant bit. To write data in,
the mode control line is taken to LOW and the data is clocked in. The data can be shifted when the mode control line is HIGH as
SHIFT is active high. The register performs right shift operation on the application of a clock pulse, as shown in the animation
below.
The D's are the parallel inputs and the Q's are the parallel outputs. Once the register is clocked, all
the data at the D inputs appear at the corresponding Q outputs simultaneously.
The registers discussed so far involved only right shift operations. Each right shift operation has the effect of successively dividing
the binary number by two. If the operation is reversed (left shift), this has the effect of multiplying the number by two. With
suitable gating arrangement a serial shift register can perform both operations.
A bidirectional, or reversible, shift register is one in which the data can be shift either left or right.
A four-bit bidirectional shift register using D flip-flops is shown below.
Here a set of NAND gates are configured as OR gates to select data inputs from the right or left
adjacent bistables, as selected by the LEFT/RIGHT control line.
The animation below performs right shift four times, then left shift four times. Notice the order of
the four output bits are not the same as the order of the original four input bits. They are actually
reversed!
Since the count sequence has 4 distinct states, the counter can be considered as a
mod-4 counter. Only 4 of the maximum 16 states are used, making ring counters
very inefficient in terms of state usage. But the major advantage of a ring
counter over a binary counter is that it is self-decoding. No extra decoding
circuit is needed to determine what state the counter is in.
Johnson Counters
Johnson counters are a variation of standard ring counters, with the inverted
output of the last stage fed back to the input of the first stage. They are also
known as twisted ring counters. An n-stage Johnson counter yields a count
sequence of length 2n, so it may be considered to be a mod-2n counter. The
circuit above shows a 4-bit Johnson counter. The state sequence for the counter
is given in the table as well as the animation on the left.
Again, the apparent disadvantage of this counter is that the maximum available states are not fully
utilized. Only eight of the sixteen states are being used.
Beware that for both the Ring and the Johnson counter must initially be forced into a valid state in
the count sequence because they operate on a subset of the available number of states.
Otherwise, the ideal sequence will not be followed.
Since the count sequence has 4 distinct states, the counter can be considered as a
mod-4 counter. Only 4 of the maximum 16 states are used, making ring counters
very inefficient in terms of state usage. But the major advantage of a ring
counter over a binary counter is that it is self-decoding. No extra decoding
circuit is needed to determine what state the counter is in.
Johnson Counters
Johnson counters are a variation of standard ring counters, with the inverted
output of the last stage fed back to the input of the first stage. They are also
known as twisted ring counters. An n-stage Johnson counter yields a count
sequence of length 2n, so it may be considered to be a mod-2n counter. The
circuit above shows a 4-bit Johnson counter. The state sequence for the counter
is given in the table as well as the animation on the left.
Again, the apparent disadvantage of this counter is that the maximum available states are not fully
utilized. Only eight of the sixteen states are being used.
Beware that for both the Ring and the Johnson counter must initially be forced into a valid state in
the count sequence because they operate on a subset of the available number of states.
Otherwise, the ideal sequence will not be followed.
Sequential Logic Circuits
Introduction
Combinational logic refers to circuits whose output is strictly depended on the present value of the inputs. As soon as inputs are changed, the
information about the previous inputs is lost, that is, combinational logics circuits have no memory. In many applications, information regarding input
values at a certain instant of time is required at some future time. Although every digital system is likely to have combinational circuits, most systems
encountered in practice also include memory elements, which require that the system be described in terms of sequential logic. Circuits whose outputs
depends not only on the present input value but also the past input value are known as sequential logic circuits. The mathematical model of a
sequential circuit is usually referred to as a sequential machine.
A general block diagram of a sequential circuit is shown below in Figure 1.
logic gates. Thus, asynchronous sequential circuits may be regarded as combinational circuits with feedback. Because of the feedback among logic
gates, asynchronous sequential circuits may, at times, become unstable due to transient conditions. The instability problem imposes many difficulties
on the designer. Hence, they are not as commonly used as synchronous systems.
Summary of the Types of Flip-flop Behaviour
Since memory elements in sequential circuits are usually flip-flops, it is worth summarising the behaviour of various flip-flop types before proceeding
further.
All flip-flops can be divided into four basic types: SR, JK, D and T. They differ in the number of inputs and in the response invoked by different value of
input signals. The four types of flip-flops are defined in Table 1.
Table 1. Flip-flop Types
FLIP-FLOP
NAME
SR
JK
FLIP-FLOP SYMBOL
CHARACTERISTIC TABLE
Q(next)
CHARACTERISTIC
EQUATION
Q(next) = S + R'Q
0
SR = 0
EXCITATION TABLE
Q(next)
Q(next)
Q(next)
Q'
Q(next)
Q(next)
Q'
Q(next) = D
Q(next)
Q(next)
Each of these flip-flops can be uniquely described by its graphical symbol, its characteristic table, its characteristic equation or excitation table. All flipflops have output signals Q and Q'.
The characteristic table in the third column of Table 1 defines the state of each flip-flop as a function of its inputs and previous state. Q refers to the
present state and Q(next) refers to the next state after the occurrence of the clock pulse. The characteristic table for the RS flip-flop shows that the
next state is equal to the present state when both inputs S and R are equal to 0. When R=1, the next clock pulse clears the flip-flop. When S=1, the flipflop output Q is set to 1. The equation mark (?) for the next state when S and R are both equal to 1 designates an indeterminate next state.
The characteristic table for the JK flip-flop is the same as that of the RS when J and K are replaced by S and R respectively, except for the
indeterminate case. When both J and K are equal to 1, the next state is equal to the complement of the present state, that is, Q(next) = Q'.
The next state of the D flip-flop is completely dependent on the input D and independent of the present state.
The next state for the T flip-flop is the same as the present state Q if T=0 and complemented if T=1.
The characteristic table is useful during the analysis of sequential circuits when the value of flip-flop inputs are known and we want to find the value of
the flip-flop output Q after the rising edge of the clock signal. As with any other truth table, we can use the map method to derive the characteristic
equation for each flip-flop, which are shown in the third column of Table 1.
During the design process we usually know the transition from present state to the next state and wish to find the flip-flop input conditions that will
cause the required transition. For this reason we will need a table that lists the required inputs for a given change of state. Such a list is called the
excitation table, which is shown in the fourth column of Table 1. There are four possible transitions from present state to the next state. The required
input conditions are derived from the information available in the characteristic table. The symbol X in the table represents a "don't care" condition, that
is, it does not matter whether the input is 1 or 0.
State Tables and State Diagrams
We have examined a general model for sequential circuits. In this model the effect of all previous inputs on the outputs is represented by a state of the
circuit. Thus, the output of the circuit at any time depends upon its current state and the input. These also determine the next state of the circuit. The
relationship that exists among the inputs, outputs, present states and next states can be specified by either the state table or the state diagram.
State Table
The state table representation of a sequential circuit consists of three sections labelled present state, next state and output. The present state
designates the state of flip-flops before the occurrence of a clock pulse. The next state shows the states of flip-flops after the clock pulse, and the
output section lists the value of the output variables during the present state.
State Diagram
In addition to graphical symbols, tables or equations, flip-flops can also be represented graphically by a state diagram. In this diagram, a state is
represented by a circle, and the transition between states is indicated by directed lines (or arcs) connecting the circles. An example of a state diagram
is shown in Figure 3 below.
Figure
3. State
Diagra
m
The binary number inside each circle identifies the state the circle represents. The directed lines are labelled with two binary numbers separated by a
slash (/). The input value that causes the state transition is labelled first. The number after the slash symbol / gives the value of the output. For
example, the directed line from state 00 to 01 is labelled 1/0, meaning that, if the sequential circuit is in a present state and the input is 1, then the next
state is 01 and the output is 0. If it is in a present state 00 and the input is 0, it will remain in that state. A directed line connecting a circle with itself
indicates that no change of state occurs. The state diagram provides exactly the same information as the state table and is obtained directly from the
state table.
Example: This example is taken from P. K. Lala, Practical Digital Logic Design and Testing, Prentice Hall, 1996, p.155.
Consider a sequential circuit shown in Figure 4. It has one input x, one output Z and two state variables Q1Q2 (thus having four possible present states
00, 01, 10, 11).
Figure 4. A
Sequential
Circuit
Present State
Q1Q2
00
01
10
11
Next State
x=0
x=1
11
11
10
10
01
00
11
10
Output
x=0
0
0
0
0
x=1
0
0
1
1
Figure 5.
State
Diagram
of circuit
in Figure
4.
NAME
STATE DIAGRAM
SR
JK
Now let's look at some examples, using these procedures to analyse a sequential circuit.
We wish to design a synchronous sequential circuit whose state diagram is shown in Figure 13. The type of flip-flop to be use is J-K.
From the state diagram, we can generate the state table shown in Table 9. Note that there is no output section for this circuit. Two flip-flops are needed
to represent the four states and are designated Q0Q1. The input variable is labelled x.
Present State
Q0 Q1
00
01
10
11
Next State
x=0
x=1
00
10
10
11
01
01
11
00
Output Transitions
Flip-flop inputs
Q Q(next)
JK
0
0
1
1
0
1
0
1
0 X
1 X
X 1
X 0
Present State
Next State
Input
Q0 Q1
Q0 Q1
00
00
01
01
10
10
11
11
00
01
10
01
10
11
11
00
0
1
0
1
0
1
0
1
Flip-flop Inputs
J0K0
J1K1
0X
0X
1X
0X
X0
X0
X0
X1
0X
1X
X1
X0
0X
1X
X0
X1
In the first row of Table 11, we have a transition for flip-flop Q0 from 0 in the present state to 0 in the next state. In Table 10 we find that a transition of
states from 0 to 0 requires that input J = 0 and input K = X. So 0 and X are copied in the first row under J0 and K0 respectively. Since the first row also
shows a transition for the flip-flop Q1 from 0 in the present state to 0 in the next state, 0 and X are copied in the first row under J1 and K1. This process
is continued for each row of the table and for each flip-flop, with the input conditions as specified in Table 10.
The simplified Boolean functions for the combinational circuit can now be derived. The input variables are Q0, Q1, and x; the output are the variables
J0, K0, J1 and K1. The information from the truth table is plotted on the Karnaugh maps shown in Figure 14.
K0 = Q1*x
K1 = Q0'*x' + Q0*x = Q0x
Design a sequential circuit whose state tables are specified in Table 12, using D flip-flops.
Present State
Next State
Output
Q0 Q1
x=0
x=1
x=0
x=1
00
01
10
11
00
00
11
00
01
10
10
01
0
0
0
0
0
0
0
1
Output Transitions
Flip-flop inputs
QQ(next)
0
0
0
1
1
0
1
0
1
1
0
1
Next step is to derive the excitation table for the design circuit, which is shown in Table 14. The output of the circuit is labelled Z.
Present State
Next State
Input
Flip-flop Inputs
Output
Q0 Q1
Q0 Q1
D0
D1
00
00
01
01
10
10
11
11
00
01
00
10
11
10
00
01
0
1
0
1
0
1
0
1
0
0
0
1
1
1
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
1
Design a sequential circuit whose state tables are specified in Table 12, using D flip-flops.
Present State
Next State
Output
Q0 Q1
x=0
x=1
x=0
x=1
00
01
10
11
00
00
11
00
01
10
10
01
0
0
0
0
0
0
0
1
Output Transitions
Flip-flop inputs
QQ(next)
D
0
0
0
1
1
0
1
0
1
1
0
1
Next step is to derive the excitation table for the design circuit, which is shown in Table 14. The output of the circuit is labelled Z.
Present State
Next State
Input
Flip-flop Inputs
Output
Q0 Q1
Q0 Q1
D0
D1
00
00
01
01
10
10
11
11
00
01
00
10
11
10
00
01
0
1
0
1
0
1
0
1
0
0
0
1
1
1
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
1
The circuit has no inputs other than the clock pulse and no outputs other than its internal state (outputs are taken off each flip-flop in the counter). The
next state of the counter depends entirely on its present state, and the state transition occurs every time the clock pulse occurs. Figure 19 shows the
sequences of count after each clock pulse.
Once the sequential circuit is defined by the state diagram, the next step is to obtain the next-state table, which is derived from the state diagram in
Figure 18 and is shown in Table 15.
Table 15. State table
Present State
Next State
Q2 Q1 Q0
Q2 Q1 Q0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
Since there are eight states, the number of flip-flops required would be three. Now we want to implement the counter design using JK flip-flops.
Next step is to develop an excitation table from the state table, which is shown in Table 16.
Table 16. Excitation table
Flip-flop inputs
Next State
Q2 Q1 Q0
Q2 Q1 Q0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
J2 K2
J1 K1
J0 K0
0X
0X
0X
1X
X0
X0
X0
X1
0X
1X
X0
X1
0X
1X
X0
X1
1X
X1
1X
X1
1X
X1
1X
X1
Now transfer the JK states of the flip-flop inputs from the excitation table to Karnaugh maps to derive a simplified Boolean expression for each flip-flop
input. This is shown in Figure 20.
Figure 20.
Karnaugh
maps
The 1s in the Karnaugh maps of Figure 20 are grouped with "don't cares" and the following expressions for the J and K inputs of each flip-flop are
obtained:
J0 = K0 = 1
J1 = K1 = Q0
J2 = K2 = Q1*Q0
The final step is to implement the combinational logic from the equations and connect the flip-flops to form the sequential circuit. The complete logic of
a 3-bit binary counter is shown in Figure 21.
Design of Counters
This example is taken from M. M. Mano, Digital Design, Prentice Hall, 1984, p.243.
Example 1.6
22.
Design a counter specified by the state diagram in Example 1.5 using T flip-flops. The state diagram is shown here again in Figure
Flip-flop inputs
Next State
T2 T1 T0
Q2 Q1 Q0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Q2 Q1 Q0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
Next step is to transfer the flip-flop input functions to Karnaugh maps to derive a simplified Boolean expressions, which is shown in Figure 23.
Figure 23.
Karnaugh
maps
T1 = Q0;
T2 = Q1*Q0
Finally, draw the logic diagram of the circuit from the expressions obtained. The complete logic diagram of the counter is shown in Figure 24.
To see the timing and state transitions of the counter, click on this image.