Synchronous Sequential Logic Overview
Synchronous Sequential Logic Overview
UNIT-IV
Synchronous Sequential Logic: Sequential circuits - Flip-flops - Analysis and design procedures - State
reduction and state assignments - Shift registers - Counters - HDL for sequential logic circuits, shift
registers and counters.
UNIT-IV
SEQUENTIAL CIRCUITS
⦿ Basic latchis a feedback connection of two NOR gates or two NAND gates
It can be set to 1 using the S input and reset to 0 using the R input
⦿ Gated latch is a basic latch that includes input gating and a control signal
⦿ The latch retains its existing state when the control input is equal to0
⦿ Its state may be changed when the control signal is equal to 1. In our discussion we
referred to the control input as the clock
◾ Gated SR latch uses the S and R inputs to set the latch to 1 or reset it
to 0, respectively.
◾ Gated D latch uses the D input to force the latch into a state that has the
samelogic value as the D input.
SVDC 1
[Type here] [Type here] [Type here]
Gated D Latch
SVDC 2
[Type here] [Type here] [Type here]
The minimum time that the input signal must be stable prior to the edge of the clock signal.
⦿ Hold Time th
The minimum time that the input signal must be stable after the edge of the clock signal.
Flip-Flops
⦿ It can have its output state changed only on the edge of the controlling clocksignal
⦿ The master stage is active during half of the clock cycle, and the slave stage is
active during the other half.
⦿ The output value of the flip-flop changes on the edge of the clock that
activates the transfer into the slave stage.
Master-Slave D Flip-Flop
SVDC 3
[Type here] [Type here] [Type here]
A Positive-Edge-Triggered D Flip-Flop
T Flip-Flop
SVDC 4
DSD [Link] KUMAR III YEAR V SEM
Excitation Tables
SVDC 5
DSD [Link] KUMAR III YEAR V SEM
Conversions of flip-flops
DSD [Link] KUMAR III YEAR V SEM
• A counter can count occurrences of events and can generate timing intervals for controlpurposes
A Simple Shift Register
DSD [Link] KUMAR III YEAR V SEM
Counters
• Counters are a specific type of sequential circuit.
• Like registers, the state, or the flip-flop values themselves, serves as the “output.”
A B A B
0 0 0 1
0 1 1 0
1 0 1 1
1 1 0 0
Benefits of counters
happened.
– Programs consist of a list of instructions that are to be executed one after another (for the
most part).
– The PC increments once on each clock cycle, and the next program instruction is then
executed.
DSD [Link] KUMAR III YEAR V SEM
A Three-Bit Up-Counter
Q1 is connected to clk, Q2 and Q3 are clocked by Q’ of the preceding stage (hence called
asynchronous or ripple counter
A Three-Bit Down-Counter
Shift registers:
In digital circuits, a shift register is a cascade of flip-flops sharing the same clock, in which
the output of each flip-flop is connected to the "data" input of the next flip-flop in the chain,
resulting in a circuit that shifts by one position the "bit array" stored in it, shifting in the data present
at its input and shifting out the last bit in the array, at each transition of the clock input. More
generally, a shift register may be multidimensional, such that its "data in" and stage outputs are
themselves bit arrays: this is implemented simply by running several shift registers of the same bit-
length in parallel.
Shift registers can have both parallel and serial inputs and outputs. These are often configured as
serial-in, parallel-out (SIPO) or as parallel-in, serial-out (PISO). There are also types that have
both serial and parallel input and types with serial and parallel output. There are also bi-
directional shift registers which allow shifting in both directions: L→R or R→L. The serial input
and last output of a shift register can also be connected to create a circular shift register
Shift registers are a type of logic circuits closely related to counters. They are basically for the
storage and transfer of digital data.
Buffer register:
The buffer register is the simple set of registers. It is simply stores the binary word. The buffer
may be controlled buffer. Most of the buffer registers used D Flip-flops.
A number of ff‘s connected together such that data may be shifted into and shifted out of them is
called shift register. data may be shifted into or out of the register in serial form or in parallel form.
There are four basic types of shift registers.
1. Serial in, serial out, shift right, shift registers
2. Serial in, serial out, shift left, shift registers
3. Parallel in, serial out shift registers
4. Parallel in, parallel out shift registers
Serial IN, serial OUT, shift right, shift left register:
The logic diagram of 4-bit serial in serial out, right shift register with four stages. The register can
store four bits of data. Serial data is applied at the input D of the first FF. the Q output of the first
FF is connected to the D input of another FF. the data is outputted from the Q terminal of the last
FF.
When serial data is transferred into a register, each new bit is clocked into the first FF at the positive
going edge of each clock pulse. The bit that was previously stored by the first FF is transferred to
the second FF. the bit that was stored by the Second FF is transferred to the third FF.
In this type of register, the data bits are entered into the register serially, but the data stored in the
register is shifted out in parallel form.
Once the data bits are stored, each bit appears on its respective output line and all bits are
available simultaneously, rather than on a bit-by-bit basis with the serial output. The serial-in,
parallel out, shift register can be used as serial-in, serial out, shift register if the output is taken
from the Q terminal of the last FF.
Parallel-in, serial-out, shift register:
For a parallel-in, serial out, shift register, the data bits are entered simultaneously into their
respective stages on parallel lines, rather than on a bit-by-bit basis on one line as with serial data
bits are transferred out of the register serially. On a bit-by-bit basis over a single line.
There are four data lines A,B,C,D through which the data is entered into the register in parallel
form. The signal shift/ load allows the data to be entered in parallel form into the register and the
data is shifted out serially from terminalQ4
In a parallel-in, parallel-out shift register, the data is entered into the register in parallel form,
and also the data is taken out of the register in parallel form. Data is applied to the D input terminals
of the FF‘s. When a clock pulse is applied, at the positive going edge of the pulse, the D inputs are
shifted into the Q outputs of the FFs. The register now stores the data. The stored data is available
instantaneously for shifting out in parallel form.
Bidirectional shift register:
A bidirectional shift register is one which the data bits can be shifted from left to right or
from right to left. A fig shows the logic diagram of a 4-bit serial-in, serial out, bidirectional shift
register. Right/left is the mode signal, when right /left is a 1, the logic circuit works as a shift-
[Link] bidirectional operation is achieved by using the mode signal and two NAND gates and
one OR gate for each stage.
A HIGH on the right/left control input enables the AND gates G1, G2, G3 and G4 and
disables the AND gates G5,G6,G7 and G8, and the state of Q output of each FF is passed through
the gate to the D input of the following FF. when a clock pulse occurs, the data bits are then
effectively shifted one place to the right. A LOW on the right/left control inputs enables the AND
gates G5, G6, G7 and G8 and disables the And gates G1, G2, G3 and G4 and the Q output of each
FF is passed to the D input of the preceding FF. when a clock pulse occurs, the data bits are then
effectively shifted one place to the left. Hence, the circuit works as a bidirectional shift register
A register is capable of shifting in one direction only is a unidirectional shift register. One that can
shift both directions is a bidirectional shift register. If the register has both shifts and parallel load
capabilities, it is referred to as a universal shift registers. Universal shift register is a bidirectional
register, whose input can be either in serial form or in parallel form and whose output also can be
in serial form or I parallel form.
The most general shift register has the following capabilities.
A universal shift register can be realized using multiplexers. The below fig shows the logic
diagram of a 4-bit universal shift register that has all capabilities. It consists of 4 D flip-flops and
four multiplexers. The four multiplexers have two common selection inputs s1 and s0. Input 0 in
each multiplexer is selected when S1S0=00, input 1 is selected when S1S0=01 and input 2 is
selected when S1S0=10 and input 4 is selected when S1S0=11. The selection inputs control the
mode of operation of the register according to the functions entries. When S1S0=0, the present
value of the register is applied to the D inputs of flip-flops. The condition forms a path from the
output of each flip-flop into the input of the same flip-flop. The next clock edge transfers into each
flip-flop the binary value it held previously, and no change of state occurs. When S1S0=01,
terminal 1 of the multiplexer inputs have a path to the D inputs of the flip-flop. This causes a shift-
right operation, with serial input transferred into flip-flopA4. When S1S0=10, a shift left operation
results with the other serial input going into flip-flop A1. Finally when S1S0=11, the binary
information on the parallel input lines is transferred into the register simultaneously during the
next clock cycle
mode control
S0 S1 register operation
0 0 No change
0 1 Shift Right
1 0 Shift left
1 1 Parallel load
Counters:
Counter is a device which stores (and sometimes displays) the number of times particular
event or process has occurred, often in relationship to a clock signal. A Digital counter is a set of
flip flops whose state change in response to pulses applied at the input to the counter. Counters
may be asynchronous counters or synchronous counters. Asynchronous counters are also called
ripple counters
In electronics counters can be implemented quite easily using register-type circuits such as
the flip-flops and a wide variety of classifications exist:
Asynchronous (ripple) counter – changing state bits are used as clocks to subsequent state
flip-flops
Synchronous counter – all state bits change under control of a singleclock
Decade counter – counts through ten states per stage
Up/down counter – counts both up and down, under command of a control input
Ring counter – formed by a shift register with feedback connection in a ring
Johnson counter – a twisted ring counter
Cascaded counter
Modulus counter.
Each is useful for different applications. Usually, counter circuits are digital in nature, and count
in natural binary Many types of counter circuits are available as digital building blocks, for
example a number of chips in the 4000 series implement different counters.
Occasionally there are advantages to using a counting sequence other than the natural binary
sequence such as the binary coded decimal counter, a linear feed-back shift register counter, or a
gray-code counter.
Counters are useful for digital clocks and timers, and in oven timers, VCR clocks, etc.
Asynchronous counters:
An asynchronous (ripple) counter is a single JK-type flip-flop, with its J (data) input fed
from its own inverted output. This circuit can store one bit, and hence can count from zero to one
before it overflows (starts over from 0). This counter will increment once for every clock cycle
and takes two clock cycles to overflow, so every cycle it will alternate between a transition from
0 to 1 and a transition from 1 to 0. Notice that this creates a new clock with a 50% duty cycle at
exactly half the frequency of the input clock. If this output is then used as the clock signal for a
similarly arranged D flip-flop (remembering to invert the output to the input), one will get another
1 bit counter that counts half as fast. Putting them together yields a two-bit counter:
Two bit ripple counter used two flip-flops. There are four possible states from 2 – bit up-
counting I.e. 00, 01, 10 and 11.
· The counter is initially assumed to be at a state 00 where the outputs of the tow flip-flops are
noted as Q1Q0. Where Q1 forms the MSB and Q0 forms the LSB.
· For the negative edge of the first clock pulse, output of the first flip-flop FF1 toggles its state.
Thus Q1 remains at 0 and Q0 toggles to 1 and the counter state are now read as 01.
· During the next negative edge of the input clock pulse FF1 toggles and Q0 = 0. The output
Q0 being a clock signal for the second flip-flop FF2 and the present transition acts as a negative
edge for FF2 thus toggles its state Q1 = 1. The counter state is now read as 10.
· For the next negative edge of the input clock to FF1 output Q0 toggles to 1. But this transition
from 0 to 1 being a positive edge for FF2 output Q1 remains at 1. The counter state is now read as
11.
· For the next negative edge of the input clock, Q0 toggles to 0. This transition from 1 to 0 acts
as a negative edge clock for FF2 and its output Q1 toggles to 0. Thus the starting state 00 is attained.
Figure shown below
Two-bit ripple down-counter using negative edge triggered flip flop:
A 2-bit down-counter counts in the order 0,3,2,1,0,1…….,i.e, 00,11,10,01,00,11 …..,etc. the above
fig. shows ripple down counter,
using negative edge triggered J-K FFs and its timing diagram.
For down counting, Q1‘ of FF1 is connected to the clock of Ff2. Let initially all the FF1
toggles, so, Q1 goes from a 0 to a 1 and Q1‘ goes from a 1 to a 0.
The negative-going signal at Q1‘ is applied to the clock input of FF2, toggles Ff2 and,
therefore, Q2 goes from a 0 to a [Link], after one clock pulse Q2=1 and Q1=1, I.e., the state
of the counter is 11.
At the negative-going edge of the second clock pulse, Q1 changes from a 1 to a 0 and Q1‘
from a 0 to a 1.
This positive-going signal at Q1‘ does not affect FF2 and, therefore, Q2 remains at a 1.
Hence , the state of the counter after second clock pulse is 10
At the negative going edge of the third clock pulse, FF1 toggles. So Q1, goes from a 0 to a
1 and Q1‘ from 1 to 0. This negative going signal at Q1‘ toggles FF2 and, so, Q2 changes
from 1 to 0, hence, the state of the counter after the third clock pulse is 01.
At the negative going edge of the fourth clock pulse, FF1 toggles. So Q1, goes from a 1 to
a 0 and Q1‘ from 0 to 1. . This positive going signal at Q1‘ does not affect FF2 and, so, Q2
remains at 0, hence, the state of the counter after the fourth clock pulse is 00.
Two-bit ripple up-down counter using negative edge triggered flip flop:
Figure: asynchronous 2-bit ripple up-down counter using negative edge triggered flip flop:
As the name indicates an up-down counter is a counter which can count both in upward
and downward directions. An up-down counter is also called a forward/backward counter
or a bidirectional counter. So, a control signal or a mode signal M is required to choose the
direction of count. When M=1 for up counting, Q1 is transmitted to clock of FF2 and when
M=0 for down counting, Q1‘ is transmitted to clock of FF2. This is achieved by using two
AND gates and one OR gates. The external clock signal is applied to FF1.
Clock signal to FF2= ([Link])+(Q1‘. Down)= Q1m+Q1‘M‘
To design a asynchronous counter, first we write the sequence , then tabulate the values of
reset signal R for various states of the counter and obtain the minimal expression for R and R‘
using K-Map or any other method. Provide a feedback such that R and R‘ resets all the FF‘s after
the desired count
Design of a Mod-6 asynchronous counter using T FFs:
A mod-6 counter has six stable states 000, 001, 010, 011, 100, and 101. When the sixth clock
pulse is applied, the counter temporarily goes to 110 state, but immediately resets to 000 because
of the feedback provided. it is ―divide by-6-counter‖, in the sense that it divides the input clock
frequency by [Link] requires three FFs, because the smallest value of n satisfying the conditionN≤2 n
is n=3; three FFs can have 8 possible states, out of which only six are utilized and the remaining
two states 110and 111, are invalid. If initially the counter is in 000 state, then after the sixth clock
pulse, it goes to 001, after the second clock pulse, it goes to 010, and so on.
After sixth clock pulse it goes to 000. For the design, write the truth table with present state
outputs Q3, Q2 and Q1 as the variables, and reset R as the output and obtain an expression for R
in terms of Q3, Q2, and Q1that decides the feedback into be provided. From the truth table,
R=Q3Q2. For active-low Reset, R‘ is used. The reset pulse is of very short duration, of the order
of nanoseconds and it is equal to the propagation delay time of the NAND gate used. The
expression for R can also be determined as follows.
The logic diagram and timing diagram of Mod-6 counter is shown in the above fig.
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 0
4 1 0 0 0
5 1 0 1 0
6 1 1 0 1
0 0 0 0
7 0 0 0 0
The count table and the K-Map for reset are shown in fig. from the K-Map R=Q4Q2. So,
feedback is provided from second and fourth FFs. For active –HIGH reset, Q4Q2 is applied to the
clear terminal. For active-LOW reset 4 2 is connected isof all Flip=flops.
After Count
pulses Q4 Q3 Q2 Q1
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 0 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 0 1 0 1
10 0 0 0 0
Synchronous counters:
Asynchronous counters are serial counters. They are slow because each FF can change state
only if all the preceding FFs have changed their state. if the clock frequency is very high, the
asynchronous counter may skip some of the states. This problem is overcome in synchronous
counters or parallel counters. Synchronous counters are counters in which all the flip flops are
triggered simultaneously by the clock pulses Synchronous counters have a common clock pulse
applied simultaneously to all flip- -Bit Synchronous Binary Counter
Step 1:State Diagram: draw the state diagram showing all the possible states state diagram which
also be called nth transition diagrams, is a graphical means of depicting the sequence of states
through which the counter progresses.
Step2: number of flip-flops: based on the description of the problem, determine the required
number n of the flip-flops- the smallest value of n is such that the number of states N≤2n--- and the
desired counting sequence.
Step3: choice of flip-flops excitation table: select the type of flip-flop to be used and write the
excitation table. An excitation table is a table that lists the present state (ps) , the next state(ns) and
required excitations.
Step4: minimal expressions for excitations: obtain the minimal expressions for the excitations of
the FF using K-maps drawn for the excitation of the flip-flops in terms of the present states and
inputs.
Step5: logic diagram: draw a logic diagram based on the minimal expressions
Step1: determine the number of flip-flops required. A 3-bit counter requires three FFs. It has 8
states (000,001,010,011,101,110,111) and all the states are valid. Hence no don‘t cares. For
selecting up and down modes, a control or mode signal M is required. When the mode signal M=1
and counts down when M=0. The clock signal is applied to all the FFs simultaneously.
Step2: draw the state diagrams: the state diagram of the 3-bit up-down counter is drawn as
Step3: select the type of flip flop and draw the excitation table: JK flip-flops are selected and the
excitation table of a 3-bit up-down counter using JK flip-flops is drawn as shown in fig.
Step4: obtain the minimal expressions: From the excitation table we can conclude that J1=1 and
K1=1, because all the entries for J1and K1 are either X or 1. The K-maps for J3, K3,J2 and K2
based on the excitation table and the minimal expression obtained from them are shown in fig.
00 01 11 10
Q3Q2 Q1M
1
1
X X X X
X X X X
Step5: draw the logic diagram: a logic diagram using those minimal expressions can be drawn as
shown in fig.
Step 1: the number of flip-flops: we know that the counting sequence for a modulo-6 gray code
counter is 000, 001, 011, 010, 110, and 111. It requires n=3FFs (N≤2n, i.e., 6≤23). 3 FFs can have
8 states. So the remaining two states 101 and 100 are invalid. The entries for excitation
corresponding to invalid states are don‘t cares.
Step2: the state diagram: the state diagram of the mod-6 gray code converter is drawn as shown
in fig.
Step3: type of flip-flop and the excitation table: T flip-flops are selected and the excitation table
of the mod-6 gray code counter using T-flip-flops is written as shown in fig.
required
PS NS excitations
Q3 Q2 Q1 Q3 Q2 Q1 T3 T2 T1
0 0 0 0 0 1 0 0 1
0 0 1 0 1 1 0 1 0
0 1 1 0 1 0 0 0 1
0 1 0 1 1 0 1 0 0
1 1 0 1 1 1 0 0 1
1 1 1 0 0 0 1 1 1
Step4: The minimal expressions: the K-maps for excitations of FFs T3,T2,and T1 in terms of
outputs of FFs Q3,Q2, and Q1, their minimization and the minimal expressions for excitations
obtained from them are shown if fig
Step5: the logic diagram: the logic diagram based on those minimal expressions is drawn as shown
in fig.
Design of a synchronous BCD Up-Down counter using FFs:
Step1: the number of flip-flops: a BCD counter is a mod-10 counter has 10 states (0000 through
1001) and so it requires n=4FFs(N≤2n,, i.e., 10≤24). 4 FFS can have 16 states. So out of 16 states,
six states (1010 through 1111) are invalid. For selecting up and down mode, a control or mode
signal M is required. , it counts up when M=1 and counts down when M=0. The clock signal is
applied to all FFs.
Step2: the state diagram: The state diagram of the mod-10 up-down counter is drawn as shown
in fig.
Step3: types of flip-flops and excitation table: T flip-flops are selected and the excitation table of
the modulo-10 up down counter using T flip-flops is drawn as shown in fig.
Q4 Q3 Q2 Q1 M Q4 Q3 Q2 Q1 T4 T3 T2 T1
0 0 0 0 0 1 0 0 1 1 0 0 1
0 0 0 0 1 0 0 0 1 0 0 0 1
0 0 0 1 0 0 0 0 0 0 0 0 1
0 0 0 1 1 0 0 1 0 0 0 1 1
0 0 1 0 0 0 0 0 1 0 0 1 1
0 0 1 0 1 0 0 1 1 0 0 0 1
0 0 1 1 0 0 0 1 0 0 0 0 1
0 0 1 1 1 0 1 0 0 0 1 1 1
0 1 0 0 0 0 0 1 1 0 1 1 1
0 1 0 0 1 0 1 0 1 0 0 0 1
0 1 0 1 0 0 1 0 0 0 0 0 1
0 1 0 1 1 0 1 1 0 0 0 1 1
0 1 1 0 0 0 1 0 1 0 0 1 1
0 1 1 0 1 0 1 1 1 0 0 0 1
0 1 1 1 0 0 1 1 0 0 0 0 1
0 1 1 1 1 1 0 0 0 1 1 1 1
1 0 0 0 0 0 1 1 1 1 1 1 1
1 0 0 0 1 1 0 0 1 0 0 0 1
1 0 0 1 0 1 0 0 0 0 0 0 1
1 0 0 1 1 0 0 0 0 1 0 0 1
Step4: The minimal expression: since there are 4 state variables and a mode signal, we require 5
variable kmaps. 20 conditions of Q4Q3Q2Q1M are valid and the remaining 12 combinations are
invalid. So the entries for excitations corresponding to those invalid combinations are don‘t cares.
Minimizing K-maps for T2 we get
T 2= Q4Q1‘M+Q4‘Q1M+Q2Q1‘M‘+Q3Q1‘M‘
Step5: the logic diagram: the logic diagram based on the above equation is shown in fig.
Ring counter: this is the simplest shift register counter. The basic ring counter using D flip- flops
is shown in fig. the realization of this counter using JK FFs. The Q output of each stage is connected
to the D flip-flop connected back to the ring counter.
Only a single 1 is in the register and is made to circulate around the register as long as clock pulses
are applied. Initially the first FF is present to a 1. So, the initial state is 1000, i.e., Q1=1,
Q2=0,Q3=0,Q4=0. After each clock pulse, the contents of the register are shifted to the right by
one bit and Q4 is shifted back to Q1. The sequence repeats after four clock pulses. The number
of distinct states in the ring counter, i.e., the mod of the ring counter is equal to number of FFs
used in the counter. An n-bit ring counter can count only n bits, where as n-bit ripple counter can
count 2n bits. So, the ring counter is uneconomical compared to a ripple counter but has advantage
of requiring no decoder, since we can read the count by simply noting which FF is set. Since it is
entirely a synchronous operation and requires no gates external FFs, it has the further advantage
of being very fast.
Timing diagram: