Sequential Circuits in Digital Design
Sequential Circuits in Digital Design
MODULE IV
SEQUENTIAL CIRCUITS
Table of Contents
Content Page No
Principle At any time, outputs are dependent At any time, outputs are dependent not
on combination of present inputs only on present inputs but also on past
inputs/outputs
All digital designers use the flip-flop for a sequential device that normally samples its inputs and changes
its output only when a clock signal is changing. On the other hand, most digital designers use latch for a
sequential device that watches its inputs continuously and can change its outputs at any time.
Latches and FFs are bistable multivibrator. Latches and flip-flops differ in the method used for changing
their state or method of gating or clocking. Latches are treated as asynchronous bistable multivibrator and
Flip flop is a synchronous bistable circuit. Latches are usually level triggered and flip flops are edge
triggered. Both these memory devices are capable storing 1-bit data.
In digital systems, a bistable device has two stable states 0 (RESET) and 1(SET). Flip-flops have a clock
input and synchronous outputs. Latches are asynchronous and their outputs can change at any time. It
may have an enable input. There are two types of Latches - SR and D latch. There are 4 types of Flip
flops: SR FF, D, FF, JK FF and T FF.
5.2 Latches
Latches are basic memory elements used in digital circuits to store and retain data. They are sequential logic
devices that can change state based on input signals and can hold that state even when the input signals change.
Unlike flip-flops, latches do not have a clock signal and can change state as soon as their input changes.
The simplest sequential circuit is the basic bistable element. It is constructed with two inverters connected
sequentially in a loop. It has no inputs and two outputs labelled as Q and Q’. As there are no inputs, it is not
possible to change the values of Q and Q’.
Let us assume Q=1 after power-on. As Q is connected to the input of second inverter, therefore Q’ is 0. A 0 at
Q’ is fed to input of first inverter and it will produce 1 at Q output, which we had assumed. Similarly, if we
assume Q=0 then we will get Q’ as 1 and we will get a stable state. Thus, there could be two stable state,
hence it is referred to as bistable element. This indicates that the bistable element has memory and it
remembers the state of the circuit.
The main disadvantage of bistable element is that it does not have any inputs, indicating that it is not possible
to change the information that is stored in it. In order to change the information, it is necessary to add inputs to
the gate which acts as an inverter. Thus we can use NOR and NAND gates for simple sequential circuit i.e.
latch.
There are four types of latches (i) Active high SR latch (ii) Active low SR latch (iii) Gated SR latch and (iv)
D-latch. Let us discuss the construction and working of these latches.
Let us now understand the SET and RESET action of latch. When S=1, the Q output of latch should be set
to Q=1. And when R=1, then the Q output will be reset to 0.
Let us now start with the SET action of latch by making S=1 and R=0. This condition will store 1 in latch.
With S=1, second NOR gate will produce Q’=0. This can be checked from the truth table of NOR gate.
When one of the inputs is 1, the output of NOR gate will be 0. Similarly, with R=0, and Q’=0 the first
NOR gate produces Q=1. The outputs are complement of each other. Thus with S=1 and R=0, produces
SET condition.
Let us see whether the data is stored or not. If we remove the inputs i.e. if we make S=0 then outputs
should not change. When S=0 and R=0, then the second NOR gate will keep Q’=0 with inputs Q=1 and
S=0. Similarly the first NOR gate with the inputs R=0 and Q’=0, produces Q=1. This clearly indicates
that when S=0 and R=0, the outputs maintains the last value i.e. it has stored the last state. This SR=00
condition is also called as memory condition. In short, we can say binary 1 is latched i.e. stored into the
circuit.
Let us now understand the RESET action of latch by making S=0 and R=1. With R=1, the first NOR gate
will produce Q=0. This can be checked from the truth table of NOR gate. When one of the inputs is 1, the
output of NOR gate will be 0. Similarly, with S=0, and Q’=1 the second NOR gate produces Q=1. The
outputs are complement of each other. Thus with S=0 and R=1, produces RESET condition.
If we remove R input i.e. when R=0 and S=0, the output of the first NOR gate will keep Q=0 with inputs
Q’=1 and R=0. Similarly the second NOR gate with the inputs R=0 and Q’=1, produces Q=0. This clearly
indicates that when S=0 and R=0, the outputs maintains the last value i.e. it stores the last state. Thus with
SR=00 condition, the outputs of latch are unchanged and maintains the last state. In short we can say
binary 0 is latched i.e. stored into the circuit.
Let us consider the last condition, when both S=1 and R=1. Both NOR gates will produce outputs 0 i.e.
Q=0 and Q’=0. In this condition, both outputs are 0. Actually Q and Q’ should be complement of each
other. Thus, there is contradiction. Therefore, S=1 and R=1 input condition is not allowed.
The truth table of S-R latch is as follows:
Inputs Outputs
Action / Comments
S R Qn+1 𝐐̅̅𝐧̅̅+̅𝟏̅
0 1 0 1 Reset
1 0 1 0 Set
1 1 ? ? Forbidden / Invalid
The main difference between the latches and flip-flops is how state changes. A latch checks input
continuously and changes the output whenever there is a change in input. But, flip flop is a combination
of latch and a clock which continuously checks input and changes the output only at time determined by
the clock. Latches can be treated just similar to a level triggered flip-flop, where the voltage level decides
the enabling of the flip-flop. Flip flops can be either edge or pulse sensitive.
5.4 S-R flip-flop
An S-R Flip-Flop (Set-Reset Flip-Flop) is a type of sequential logic device that has two inputs, S (Set)
and R (Reset), and two outputs, Q (output) and Q̅ (complement of the output). It is also known as an S-R
latch with clock enable. The S-R flip-flop can store one bit of binary data and can change its state based
on the inputs and clock signal.
5.4.1 Block Diagram:
The block diagram of S-R flip-flop is as follows:
5.4.2. Circuit Diagram and Working Principal
S-R flip-flop by using NOR gate is as follows
When Clock is 1 and both S and R inputs are 0 then inputs to latch are 11. Therefore, Q and Q’ will not
change. The output remains in the last state. The output of SR flip-flop will be RESET, if clock input is
High and SR inputs are 01. The SR flip-flop output goes High when clock input is 1 and SR inputs are 10.
This is a SET condition for the flip-flop. If both SR inputs are high (1) then the flip flop generates invalid
output i.e. both Q and Q’ are at 0 level. This generates invalid condition, which is not allowed. When
clock level is 0 then irrespective of S and R inputs latch inputs at high (1) state. Therefore, both the
outputs do not change. Thus, last state is maintained.
5.4.3 Present state – next state table and K-map simplification
5.5 D Flip-flop
A D flip-flop (Data flip-flop) is a type of edge-triggered sequential logic device that stores and transfers
data based on the clock signal. It has a single data input (D), a clock input (CLK), and two outputs: Q
(output) and Q̅ (complement of the output). The D flip-flop transfers the data input (D) to its output (Q)
on the rising edge or falling edge of the clock signal, depending on its specific implementation.
5.5.1 Block Diagram
When the clock input is high, the Q output follows the input D. It is possible to store data 0 or 1 in the
flip-flop. When D=0 then flip flop output is RESET state and at D=1, the flip flops stores 1 i.e. SET state.
During low level of clock irrespective of the value of D input, the Q output of flip flop do not change
irrespective of D input. Thus, flip-flop keeps the last state. As the inputs appear at output after some delay,
hence D flip flop is also called as Delay flip flop.
5.5.4 Present state – next state table and K-map simplification
5.5.5 Excitation Table of D flip-flop
The JK flip-flop is an SR flip-flop with feedback which enables only one of its two inputs to be active at
any given time. When clock is High (i.e. logic 1) and both JK inputs are 00 then, the latch output do not
change. Thus, JK flip flop holds the last state. The flip-flop enters into RESET mode (i.e. Q=0), when J=0
and K=1 with high state on clock. When J=1 and K=0, with clock input at High state, the output enter in
SET mode by setting Q as 1.
When clock as well as both J and K inputs are HIGH then output toggles from its previous state i.e. if
Q=0 then it becomes 1 and if Q=1 then it becomes0. Let us consider Q=0 and Q’=1 then output of J side
NAND gate provide 0 which changes the output to 1. Let us find out the change at k-side NAND gate. Q
is initially 0, the K side NAND will provide output as 1 and with new Q as 1 the final Q’ changes to 0
from 1. Now let us consider a case when clock is inactive. I.e. when clock is Low (0), the outputs do not
change irrespective of the JK inputs. This is once again the hold state of JK flip-flop.
5.6.3 Present state – next state table and K-map simplification
When J=0 and K=0 at pulse triggering, there is no change at the output of the flip flop. In short, the flip-
flop holds the last state. When J=0 and K=1 at pulse trigger, the flip flop enters in Reset state i.e. Q=0.
Flip flop enters into SET state, when J=1 and K=0 at pulse clock transition. When J=1 and K=1 at
triggering transition, the flip flop toggles i.e. goes to the complement of the present state. Note that, in this
pulse triggering method, the flip-flop changes the state only once after a clock pulse. Thus, the problem of
racing is avoided.
5.9 Realization of one flip-flop using other flip-flops
5.9.1 Realization of D flip-flop using S-R flip-flop
A D flip-flop can be realized using two S-R (Set-Reset) flip-flops and some additional logic gates. The D
flip-flop has a single data input (D) and two outputs (Q and Q̅). The Q output follows the D input, while
the Q̅ output is the complement of the Q output.
Present state – next state table for D flip-flop
Excitation table for D flip flop realization using S-R flip-flop
5.11. Counter
In digital logic and computing, a counter is a device which stores (and sometimes displays) the number of
times a particular event or process has occurred, often in relationship to a clock. The most common type
is a sequential digital logic circuit with an input line called the clock and multiple output lines. The values
on the output lines represent a number in the binary or BCD number system. Each pulse applied to the
clock input increments or decrements the number in the counter.
A counter circuit is usually constructed of a number of flip-flops connected in cascade. Counters are a
very widely used component in digital circuits, and are manufactured as separate integrated circuits and
also incorporated as parts of larger integrated circuits.
An electronic counter is a sequential logic circuit which has a clock input signal and a group of output
signals that represent an integer "counts" value. Upon each qualified clock edge, the circuit will increment
(or decrement, depending on circuit design) the counts. When the counts have reached the end of the
counting sequence (maximum counts when incrementing; zero counts when decrementing), the next clock
will cause the counts to overflow or underflow and the counting sequence will start over. Internally,
counters use flip-flops to represent the current counts and to retain the counts between clocks. Depending
on the type of counter, the output may be a direct representation of the counts (a binary number) or it may
be encoded.
Some counters provide a Terminal Count output which indicates that the next clock will cause overflow
or underflow. This is commonly used to implement counter cascading (combining two or more counters
to create a single, larger counter), by connecting the Terminal Count output of one counter to the Enable
input of the next counter.
The modulus of a counter is the number of states in its count sequence. The maximum possible modulus
is determined by the number of flip-flops. For example, a four-bit counter can have a modulus of up to 16
(2^4).
Counters are generally classified as either synchronous or asynchronous. In synchronous counters, all
flip-flops share a common clock and change state at the same time. In asynchronous counters, each flip-
flop has a unique clock and the flip-flop states change at different times.
Synchronous counters are categorized in various ways. For example:
Modulus counter – counts through a particular number of states.
Decade counter – modulus 10 counter (counts through ten states).
Up/down counter – counts both up and down, as directed by a control input.
Ring counter – formed by a "circular" shift register.
Johnson counter – a twisted ring counter.
Therefore, in the down counter, the counter content is decremented by one for every negative transition in
clock.
5.12.4 4-bit ripple down counter
The block diagram and truth table of 4-bit ripple/asynchronous down counter are as follows
5.12.5 3-bit ripple/asynchronous up-down counter
The UP-DOWN counter is a combination of the up-counter and the down-counter. As the UP-DOWN
counter has the capability of counting upwards as well as downwards, it is also called multimode counter.
In an up counter each flip-flop is triggered by the normal output of the preceding flip-flop; in a down
counter, each flip flop is triggered by the inverted output of the preceding flip-flop. In both the counters,
the first flip-flop is triggered by the input pulses.
The block diagram and truth table of 3-bit ripple/asynchronous up-down counter are as follows
Here, three logic gates per stage are required to switch the individual stages from count-up and count-
down mode. The logic gates are used to allow either the non-inverted output or the inverted output of one
flip-flop to the clock input of the following flip-flop, depending on the status of the control inputs. When
the count up line is held at 1 while the count-down line is at 0, the lower AND gates will be disabled and
there outputs are zero. So, it will have no effect on the outputs of OR gates. Also, the upper AND gates
will be enabled, i.e. it will allow QA to pass through the OR gate and into the clock input of the B flip-
flop. Similarly, the QB and QC outputs will be gated into the clock input of flip-flop C and D respectively.
Thus, as input pulses are applied, the counter will count up and follow a natural binary counting sequence
from 0000 to 1111.
With COUNT-UP = 0, COUNT-DOWN = 1, the upper AND gates are disabled and the lower AND gates
are enabled, allowing 𝑄̅̅𝐴̅, 𝑄̅̅𝐵̅ and 𝑄̅̅𝐶̅ to pass through to the clock inputs of the following flip-flops. Thus
for this condition, the counter will count down as input pulses are applied.
When the control inputs are both 0 or 1, the counter will not count up or count down because the clock
inputs of B, C and D will be held constant at either 0 or 1. The flip-flop A will keep toggling because it is
always being clocked. This conditions are not normally used.
5.13 MOD ripple counter
5.13.1 MOD Number:
The MOD-number of a counter is the total number of states it sequences through in each complete cycle.
MOD-Number = 2n
Where n = Number of flip-flops.
The maximum binary number counted by the counter is 2n − 1. Thus a 4- flip-flop counter can count as
high as 24 − 1 = 15
5.13.2. Ripple counter with modulus < 𝟐𝐧 – MOD-6 ripple counter
A MOD-6 ripple counter is a type of asynchronous (ripple) counter that counts in a sequence from 0 to 5
(MOD-6) and then resets back to 0. It uses three flip-flops to represent the counter's binary state, as the
MOD-6 counter requires three bits to represent six different states (0 to 5). A MOD -6 ripple counter is
shown in figure.
Without the NAND gate, the counter functions as a MOD-8 binary counter, which counts from 000 to
111. However, the presence of the NAND gate alters this sequence as follows:
a. The NAND gate output is connected to the CLEAR inputs of each flip-flop. As long as the NAND gate
output is HIGH, it will have no effect on the counter. When the NAND gate output goes LOW, it will
clear all flip-flops, and the counter immediately goes to the 000 state.
b. The output of the counter QB and QC are given as inputs to the NAND gate. The NAND gate outputs
goes LOW whenever QB = QC = 1. This condition will occur when the counter goes from 101 state to the
110 state. The LOW at the NAND gate output will clear the counter to the 000 state. Once flip-flops have
been cleared, the NAND gate output goes back to HIGH, since QB = QC = 1 condition no longer exists.
c. Therefore, the counting sequence is 000 → 001 → 010 → 011 → 100 → 101 → 000 → ……
So, it essentially skips 110 and 111 states going only through six different states; thus it is a MOD-6
counter.
5.14. Synchronous Counter:
A synchronous counter is a type of digital counter that uses flip-flops and synchronous clock signals to
count in a predetermined sequence. Unlike asynchronous (ripple) counters, all the flip-flops in a
synchronous counter are triggered simultaneously by the same clock signal, ensuring that all bits of the
counter change state at the same time. This eliminates the ripple effect and provides more precise and
reliable counting.
5.14.1 Synchronous Up Counter:
Asynchronous counter is the simplest type of binary counters as it requires less hardware. But its speed of
operation is low because the propagation delay time of all flip-flop is cumulative and the total settling
time is the product of the total number of flip-flops and the propagation delay of single flip-flop. Another
problem encountered with ripple counter is the glitches at the decoding gate outputs. These problems can
be eliminated by applying clock pulses to all the flip-flop simultaneously, which is done in synchronous
counter. The speed of operation in a synchronous counter is limited by the propagation delay of control
gating and flip-flop.
In a 4-bit synchronous up-counter, the clock inputs of all the flip-flops are connected together so that the
input clock signal is applied simultaneously to each flip-flop. Also, only the LSB flip flop A has its J and
K inputs connected permanently to VCC, while J and K inputs of the other flip-flops are driven some
combination of flip-flop outputs. The J and K inputs of the flip-flop B connected with Q A output of flip-
fop A; the J and K of flip-flop C are connected with AND operated output of QA and QB; similarly the J
and K of flip-flop D are connected with AND operated output of QA, QB and QC. As shown in figure and
according to the truth table, the flip-flop A changes its state with the occurrence of negative transition of
each clock-pulse. The flip-flop B changes its state when Q A = 1 and when there is negative transition at
clock input. Flip-flop C changes its state when QA = QB = 1 and when there is negative transition at clock
input. Similarly, flip-flop D changes its state when QA = QB = QC = 1 and when there is negative
transition at clock input.
Total delay = propagation delay of one flip-flop + propagation delay of AND gate
The above total delay will be same irrespective of the number of flip-flops present in the counter, and it
will normally be much lower than that of asynchronous counter with the same number of flip-flops.
Therefore, the speed of operation of synchronous counters is limited only by the propagation delays of a
single flip-flop and an AND gate. Thus, the maximum frequency of operation of synchronous counters is
given by
1
fmax
t p tg
tp = propagation delay of one flip-flop
tg = propagation delay of one AND gate
5.14.2 Synchronous Down Counter
A parallel down counter can be made to count down by using the inverted outputs of the flip-flops to feed
the various logic gates.
5.14.3 Synchronous Up/Down Counter:
To form a parallel UP/DOWN counter, the control inputs (COUNT UP and COUNT DOWN) are used to
allow either the normal output or the inverted output of flip-flop to the J and K inputs of the following
flip-flop. A MOD-8 UP/DOWN counter which will count from 000 to 111 when the COUNT UP = 1 and
COUNT DOWN = 0 or from 111 to 000 when the COUNT UP = 0 and COUNT DOWN = 1, is shown is
figure.
A logical 1 on the COUNT UP line while COUNT DOWN = 0 enables AND gates 1 and 3 and disables
gates 2 and 4. This allows the QA and QB outputs through the AND gates to the J and K inputs of the
following flip-flops, so that the counter counts up as pulses are applied. The reverse action takes place
when COUNT UP = 0 and COUNT DOWN = 1.
5.15 MOD Synchronous Counter
5.15.1 MOD -3 Counter
MOD -3 counter is one with three states. To design a counter with three states the number of flip-flops
required can be found using the following equation
2n N 2n1
where, n is the number of flip-flops required and N is the number of states present in the counter. For
N=3, from the above equation, n=2, i.e. two flip-flops are required to design.
Present state – next state table for MOD -3 counter
In the first row of the above table, for the flip-flop B of the counter to change from present state 0 to next
state 0, the JBKB inputs required are 0d; for flip-flop A to change from present state 0 to next state 1, the
JAKA inputs required are 1d. Similarly, other entries are also made using the application table.
5.15.2 MOD -6 Counter
MOD -6 counter is one with three states. To design a counter with three states the number of flip-flops
required can be found using the following equation
2n N 2n1
where, n is the number of flip-flops required and N is the number of states present in the counter. For
N=6, from the above equation, n=3, i.e. three flip-flops are required to design.
Present state – next state table for MOD -6 counter
In the first row of the above table, for the flip-flop D of the counter to change from present state 0 to next
state 0, the JDKD inputs required are 0d; for the flip-flop C of the counter to change from present state 0 to
next state 0, the JCKC inputs required are 0d; for flip-flop B to change from present state 0 to next state 1,
the JBKB inputs required are 0d; for flip-flop A to change from present state 0 to next state 1, the J AKA
inputs required are 1d;. Similarly, other entries are also made using the application table.
5.16. Registers
In almost all cities, we see various big rolling displays advertising different products or sales. This is one
of the most popular applications of shift register. Text/image can enter from left or right and moves out
sequentially. Similarly, data can be loaded inparallel from top and leaves towards bottom. For long
distance data communication, shift register can convert slow parallel data into high speed serial over
single wire and serial to parallel at a receiver end. This helps in reducing the cost of data transmission.
Shift registers like counters are basically some form of sequential circuit. Unlike combinational circuit,
sequential circuit outputs are not only dependent of present inputs but also on the past inputs as well.
Flip flops are used for storing binary information. Single flip flop can store 1-bit binary data either 0 or 1.
To increase the storage capacity, we need to use group of flip flops. Register is a group of flip flops
connected together to store multiple bits. The n-bit register consist of n number of flip flops and is
capable of storing n-bit information. For example 8-bit register can store 8-bit data for a computer and
requires 8 flip flops. Binary data can be entered serially or parallel into the register. Similarly, the data can
be shifted out in serial or parallel out on every clock pulse.
Shift registers are classified into 4 types depending upon how the data is shifted in and shifted out either
serially or parallel. In addition, there are bidirectional shift registers, ring and Johnson counter. There are
MSI shift registers available commercially in TTL as well as in CMOS families.
5.17 Types of shift registers
Shift registers are a type of sequential logic circuit. Shift register has two important keywords. The first
one is shift and the second is register. Register is basically a group of flip flops connected in such a way
that binary number can be entered into the register. Single flip flop can store only ‘1’bit data. For storing
‘n’-bits, n flip flops are required for storage. Shift register is capable of storage as well as shift or data
transfer.
For handling the binary data, there are two main operations Shift-In for data entry and Shift-Out for data
transfer or exit. Both the operations can be implemented either bit by bit i.e. serially or all-bits-
simultaneously i.e. in parallel.
Shift registers can have serial or parallel inputs and outputs. There are some shift registers that have both
serial and parallel inputs and outputs as shown in figure 1.
Classification of shift register depends on how the data is shifted IN and shifted-OUT i.e. whether the
data input and output are serial or parallel. There are four basic types of shift registers:
1. Serial In Serial Out (SISO) shift register
2. Serial In Parallel Out (SIPO) shift register
3. Parallel In Serial Out (PISO) shift register
4. Parallel In Parallel Out (PIPO) shift register
When the data is to be moved serially both at the input or output, the type of shift register used is serial in
serial out (SISO).
If the data is fed serially at the input and is retrieved in parallel manner at the output, the shift register is
known as serial in parallel out (PISO). This action results in serial to parallel conversion.
When data is entered in parallel and taken out in a serial fashion, the shift register is called parallel in
serial out (PISO) register. This shift register is also called parallel to serial converter.
Finally, if both the input and output are in parallel manner, the shift register is termed as parallel in
parallel out PIPO) register.
In all four types, the storage as well as transfer of data takes place only upon the applications of clock
pulses. When the clock is absent, the original data is retained till power is on and shift register acts like a
temporary memory.
5.18 Different ways to transfer/move data
The possible ways of data movements in a shift register are shown in figure 2. Registers are implemented
using flip flops that provide storage capacity. In this case, a 4-bit shift register is used for shift and
storage. The arrow indicates the direction and type of data transfer. Data is entered serially and shifted
right or left. It is also possible to introduce rotate right or left operation using closed loop path. Serial
operation requires at least four clock pulses for 4-bit register to shift the data to left or right. For faster
operation, data can be entered in using parallel shift in operation or parallel shift out in single clock cycle.
5.19 Serial–in serial–out shift register
The serial in serial out (SISO) shift register is a simply collection of clocked flip flops linearly connected.
This register accepts data serially (one bit at a time) and shifts or moves the data serially through various
stages of the registers and exits form last flip flop serially.
Let us consider a 4 bit shift register constructed using four D-flip flop in cascade as shown in figure 4.
External serial data is fed to the first D flip flop and data exits serially from the fourth i.e. last flip flop.
Each flip flop has its outputs connected to the inputs of the next in line. The same clock input goes to all
flip –flops and they are all negative edge triggered.
Let us study the operation of SISO register. The shift register is initially in clear state i.e.(Q A QB QC QD=
0000). Consider data to be entered as 0101. Data must be entered beginning with right most bit first
(LSB). The serial data input ‘1’ is applied to the first FF. When the first clock pulse is applied, the first FF
output becomes QA=1. The register contains now 1000. Now the second bit is applied to the data input.
D=0 for first flip flop and D=1 for the second flip flop. When second clock pulse is applied, at negative
transition, The second FF output QB changes to 1 and QA becomes 0. The register contains now 0100. The
third bit 1 at serial input is allowed to store in the first FF with the third clock pulse. The 0 stored in first
FF is shifted to second flip flop and 1 stored in second flip flop is shifted to third flip flop. The register
output is 1010. With the fourth clock pulse, the last bit 0 is present at serial input and is shifted into first
flip flop and QA becomes 0. Bit stored in first FF is shifted to second FF i.e. 1. The 0 stored in second FF
is shifted to third FF. The LSB =1 stored in third FF is shifted to last FF. The register now contains 0101.
After shift in operation, first (right most) bit of serial data is available at the serial data output. The second
data bit is shifted out at the next clock transition. Similarly third bit is also shifted out and last bit is
available with next clock transition The register is of right shift type and the stored data is shifted out of
the right and lost after eight clock cycles.
Let us summarize the operation. In SISO register, first bit is entered into the register on the first clock
pulse and then shifted from left to right as remaining bits are entered and shifted. In such register, for
serial data one bit at a time is transferred into or out of the register. Therefore, 4 clock pulses are required
to transfer the data into the register and additional 3 clock pulses are required to shift data out of the
register serially.
5.19.1 Serial–in serial–out shift register using JK flip-flop
Operation
This type of shift register accepts data in parallel form and outputs it in serial form. With a single clock
pulse, data bits are entered simultaneously into the respective flip flop stages of the shift register and
output is available bit by bit from last storage. For PISO register, it is necessary to shift the data after
loading it in parallel. But unfortunately, the two acts - parallel loading and shifting serially cannot occur
simultaneously.
This register consists of 4 D flip flops. All flip flops are triggered simultaneously by a common clock.
There are four parallel data inputs ABCD applied to the register. Parallel data bits and outputs of previous
stage are given as inputs to two AND gates. Other input comes from direct control and inverted control as
shown here. Outputs of the two AND gates act as inputs for the OR gate whose output is fed as input to
the next stage of shift register as shown in figure 7.
Let us consider parallel data ABCD=0101. When the control line LOW, second AND gate is enabled and
first AND is disabled. So parallel data bit appears as data input.
Application of one clock pulse now allows this parallel data to be stored into the 4-bit register. Advantage
of this configuration is that any number of bits are transferred into the register in a single clock pulse.
With one clock pulse the parallel data available at D input appears at the output of register.
On the other hand, when control line is HIGH, first AND gate is enabled i.e. the Q output of previous FF
appears as data input to the next stage. Here, four clock pulses are required to shift the data out of the
register serially. The output of last FF Q3 acts as a serial data output of the shift register.
5.22 Parallel–in parallel–out shift register
In the 4 bit parallel in parallel out shift register, four independent D flip are used as shown in figure. The
D inputs are acting as the parallel inputs and Q outputs of the FFs act as the parallel outputs of the shift
register. Let us consider the parallel data ABCD = 0101.
The clock inputs of all FFs are triggered by a single clock signal. Once the register is clocked, all the data
at the D inputs appear at corresponding Q outputs of the FFs simultaneously. This shift register requires
only one clock pulse for operation; hence it is the fastest shift register.
5.23 Bidirectional shift register
It is the shift register in which the data can be shifted either left or right. The four bit bidirectional shift
register using D flip flops is shown in figure 9. There are two AND gates and a OR gate used at the input
of each D flip flop. This combinational circuit allows the serial data to be shifted left or right based on the
Left/Right shift control pin.
Let us consider a binary data 1101 applied to the serial data in for left shift. The M input is set to 0. With
this control input, the inverter produces 1 at the output which enables the second AND gates of the
combinational circuit. This allows data present at second AND gate to pass through OR gate to D inputs
of the FFs. The D input of FFD receives the serial data; D input of FFC receives QD output; D input of FFB
receives QC output and D input of FFA receives QB output.
Application of a clock pulse shifts the data to the left by 1 bit position. After four clock pulses, the output
of left shift register contains the data 1101. It further requires 3 clock pulses to shift the data out serially
from Q0 of the left shift register.
Let us consider a binary data 0101 applied to the serial data in for right shift. The M input is set to 1. With
this control input, the first AND gates of the combinational circuit is enabled. This allows data present at
first AND gate to pass through OR gate to D inputs of the FFs. The D input of FFA receives the serial data
input; D input of FFB receives QA output; D input of FFC receives QB output and D input of FFD receives
QC output.
Application of a clock pulse shifts the data to the right by 1 bit position. After four clock pulses, the
output of right shift register contains the data 0101. It further requires 3 clock pulses to shift the data out
serially from QD of the right shift register.
5.24 Universal shift register
A universal shift register can transfer data in three different modes. It can load and transmit data in
parallel. It can load and transmit data in serial fashion, through left shifts or right shift. This allows user to
activate either SISO, SIPO, PISO and PIPO shift register. 4bit Universal shift register consist of 4 positive
or negative edge triggered D flip flops.
Serial in or serial out can be implemented by shifting the data in any one of the two directions. Left shift
requires QA ← QB ← QC ← QD ← serial Data in whereas the right shift requires Serial data in → QA
→ QB → QC → QD.
For SISO, the shift in operation needs shift/load input connected to HIGH state and will take 4 clock
pulses to shift the data serially in. The shift out operation also need shift/load input kept connected to
HIGH state and will require 3 clock pulses shift data serially out. This is because the output already has
LSB before shift out operation begins. For SIPO, the Shift/load operation is connected at HIGH state and
will require no clock pulse to take the data is already available at the outputs.
For PISO operation, shift/load input be connected to LOW state to enable parallel load operation. For
shift out operation, the shift/load input must be connected to HIGH state for shift serial OUT and will
require 3 pulses again. For PIPO operation, shift/load input be connected to LOW state to enable parallel
load operation and requires only 1 clock pulse to load the data in parallel and no clock pulse to take the
data at output since it is always available at the output.
For shift left operation, parallel data input (Dn) receives Qn+1 output, hence shift/load be connected to
low state for both modes.
5.25 Ring counter
Ring counter is a type of shift register with the output of the last flip flop is fed back to the input of the
first flip flop. The data stored within the shift register will circulate as long as clock pulses are applied.
The 4-bit ring counter consists of four D flip flops with clock input connected to the common clock.
External RESET input is connected to Preset input of the first FF and Clear input of all remaining flip
flops as shown in figure.
Let us understand the working of ring counter with the help of function table. Initially, an active LOW
level is applied to Reset input, which sets QA as 1 and other flip flop outputs will be 0. The contents of
the register are QAQBQCQD =1000 as shown in figure.
Application of first clock pulse shifts the logic 1 to QB as D input of second FF is connected to QA. The
register now contains 0100. Application of second clock pulse shifts the logic 1 to Q C as D input of third
FF is connected to QB. The register now contains 0010. Further application of third clock pulse shifts the
logic 1 to QD as D input of fourth FF connected to QC. The register now contains 0001. Forth clock pulse
shifts the logic 1 to QA as D input of fourth FF connected to QD. The register now contains 1000 again
and ring counter operation continues further.
5.26 Johnson counter
A Johnson counter is a modified ring counter in which the complemented output of the last flip flop is
connected to the input of the first flip flop. Johnson counter is also called as twisted ring counter.
Let us consider a 4-bit Johnson counter constructed using 4-D flip flops as shown in figure. The circular
connection is made from complement output of the rightmost flip flop to the input of the leftmost D flip
flop. The register shifts its contents one bit position to the right with every clock pulse and the
complement value of last flip flop is transferred to the first flip flop at the same time.
Let us understand the working of Johnson counter. Initially, an active LOW level is applied to the clear
input, which resets all the flip flops. Thus the register contains QAQBQCQD =0000. With the first clock
pulse, the first flip flop inserts 1 into the register as 𝑄̅̅𝐷̅ =1. The content of the counter are 1000. With the
second clock pulse, new ‘1’ is added into the register as 𝑄̅𝐷̅ ̅ =1. The content of the counter is now 1100.
Next clock pulse generates the counter contents as 1110. Fourth clock pulse shifts the whole contents to
right and adds 1 to the left position. Thus we get 1111.
As QD=1, the complement of QD is 0. Now the value ‘0’ is inserted into the register. Thus, with the next
clock pulse, the counter contains 0111. Next counter becomes 0011 with next clock pulse. Further it
becomes 0001 with the clock pulse. Finally the counter becomes 0000 with the clock pulse.
Starting from the clear state, the Johnson counter goes through a sequence of 8 states. In general, a n-bit
twisted ring Johnson counter will go through a sequence of 2×n states. The disadvantage of Johnson
counter is that it does not count in binary sequence.
5.27 Applications of shift registers
Shift register are used in variety of applications as listed below.
1. Delay line- The SISO register can be used to introduce time delay. The delay is proportional to
number of flip flops.
2. Serial to parallel converter- Serial in parallel out (SIPO) shift register can be used to convert data
in serial form to parallel form e.g. keyboard interfacing.
3. Parallel to serial converter- A parallel in serial out ( PISO ) shift register can be used to convert
data in parallel form to serial form. This is required in a situation where parallel data transmission
is not feasible at long distance e.g. modem/router interfacing.
4. Sequence generator- sequence to operate various electronic gadgets can be obtained using shift
register
5. Ring counter - a particular set of control signals can be generated using ring counter.
1. Shift register is also used in
6. Pulse train generator
7. Registers in processors
8. Keyboard encoding
9. Rolling display
10. Universal asynchronous receiver transmitter (UART)
5.28 Exercise