Basic Electronics (18ELN14/18ELN24) - Introduction To Sequential Circuits (Module 5)
Basic Electronics (18ELN14/18ELN24) - Introduction To Sequential Circuits (Module 5)
Introduction
Digital circuits are classified into two types – Combinational circuits and Sequential
circuits. Combinational circuits are the circuits in which the output depends on the present
inputs only. Sequential circuits are the circuits in which the output depends on the present input
as well as the previous state of the system. The sequential circuits have memory. Table 1 lists
the differences between combinational and sequential circuits.
Table 1 Differences between combinational and sequential circuits
Flip-Flop
A flip-flop is an electronic circuit which has memory. It is a bistable digital circuit, i.e., its
outputs have two stable states: logic 1 and logic 0. It is the basic element of all sequential systems.
Latches Flip-Flops
Latches are controlled by an enable signal Flip-flops are controlled by a clock signal
Latches are positive or negative level- Flip-flops are positive or negative edge-
triggered, i.e., the output changes whenever triggered, i.e., the output changes whenever
the enable is 1 (for positive level-triggered) or the clock changes from 0 to 1 (for positive
0 (for negative level-triggered) edge-triggered) or 1 to 0 (for negative edge-
triggered)
Latches are building blocks of sequential Flip-flops are also building blocks of
circuits and are built from basic gates sequential circuits and are built from latches
A latch continuously checks its inputs and A flip-flop continuously checks its inputs and
changes its output whenever the enable is changes its output only at times determined
HIGH by the clock signal
The operation of a latch is faster as they do not Flip-flops are comparatively slower as they
have to wait for clock signal have to wait for clock signal
SR Flip-Flop
An SR Flip-Flop (also called RS Flip-Flop) is formed by cross connecting two NOR gates
as shown in Fig. 2.
Operation
The inputs are 𝑆 and 𝑅. Hence there are four conditions:
i. If 𝑺 = 𝑹 = 𝟎
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (0,1).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0).
So its output is 𝑄 = 1. The inputs to the gate 2 are (1,0). So its output is 𝑄̅ = 0.
That is, if 𝑆 = 𝑅 = 0, there is no change in the output.
ii. If 𝑺 = 𝟎, 𝑹 = 𝟏
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,1).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (1,0).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
That is, if 𝑆 = 0, 𝑅 = 1, the output is reset (𝑄 = 0).
iii. If 𝑺 = 𝟏, 𝑹 = 𝟎
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 2 are (0,1).
So its output is 𝑄̅ = 0. The inputs to the gate 1 are (0,0). So its output is 𝑄 = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0).
So its output is 𝑄 = 1. The inputs to the gate 2 are (1,1). So its output is 𝑄̅ = 0.
That is, if 𝑆 = 1, 𝑅 = 0, the output is set (𝑄 = 1).
iv. If 𝑺 = 𝑹 = 𝟏
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,1).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,1). So its output is 𝑄̅ = 0.
Here 𝑄 = 0 and 𝑄̅ = 0, which is not possible. So the output is not valid.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (1,0).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,1). So its output is 𝑄̅ = 0.
Again 𝑄 = 0 and 𝑄̅ = 0, which is not possible. So the output is not valid.
That is, if 𝑆 = 𝑅 = 1, the output is not valid. Hence this is forbidden.
Considering all the four cases, the truth table is written as below.
Truth Table:
0 0 0 0 0 0 𝑄𝑛 No change
No change
0 0 1 1
0 1 0 Reset
0 1 0 0
Reset 1 0 1 Set
0 1 1 0
Forbidden
1 0 0 1 1 1 ?
Set (Illegal)
1 0 1 1
1 1 0 ? Forbidden
𝑄𝑛 - Present state output
1 1 1 ? (Illegal)
𝑄𝑛+1 - Next state output
Clocked SR Flip-Flops
Within a digital computer, a clock is used to synchronize changes in the contents of
memory elements. A clock is a signal which oscillates between 0 and 1 as shown in Fig. 3.
In a clocked SR flip-flop, a clock (CLK) signal is fed to the AND gates 3 and 4 as shown in
Fig. 4.
Operation
When the clock is HIGH (1), the outputs of gates 3 and 4 are 𝑅 and 𝑆 respectively. So the
flip-flop operates normally.
When the clock is LOW (0), the output of the gates 3 and 4 are (0,0), which implies that
the output does not change and the flip-flop is said to be disabled.
The operation can be analyzed for the following conditions:
i. If 𝑪𝑳𝑲 = 𝟏 and 𝑺 = 𝑹 = 𝟎
In this case, the outputs of gates 3 and 4 are (0,0) respectively.
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (0,1).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0).
So its output is 𝑄 = 1. The inputs to the gate 2 are (1,0). So its output is 𝑄̅ = 0.
That is, if 𝐶𝐿𝐾 = 1 and 𝑆 = 𝑅 = 0, there is no change in the output.
ii. If 𝑪𝑳𝑲 = 𝟏 𝐚𝐧𝐝 𝑺 = 𝟎, 𝑹 = 𝟏
In this case, the outputs of gates 3 and 4 are (0,1) respectively.
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,1).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (1,0).
So its output is 𝑄 = 0. The inputs to the gate 2 are (0,0). So its output is 𝑄̅ = 1.
That is, if 𝐶𝐿𝐾 = 1 and 𝑆 = 0, 𝑅 = 1, the output is reset (𝑄 = 0).
iii. If 𝑪𝑳𝑲 = 𝟏 𝐚𝐧𝐝 𝑺 = 𝟏, 𝐑 = 𝟎
In this case, the outputs of gates 3 and 4 are (1,0) respectively.
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 2 are (0,1).
So its output is 𝑄̅ = 0. The inputs to the gate 1 are (0,0). So its output is 𝑄 = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0).
So its output is 𝑄 = 1. The inputs to the gate 2 are (1,1). So its output is 𝑄̅ = 0.
1 0 0 0 0 1 0 0 𝑄𝑛 No change
No change
1 0 0 1 1
1 0 1 0 Reset
1 0 1 0 0
Reset 1 1 0 1 Set
1 0 1 1 0
Forbidden
1 1 0 0 1 1 1 1 ?
Set (Illegal)
1 1 0 1 1
0 X X 𝑄𝑛 No change
1 1 1 0 ? Forbidden
1 1 1 1 ? (Illegal)
𝑄𝑛 - Present state
0 X X 0 0
No change output
0 X X 1 1
𝑄𝑛+1 - Next state output
X – Don’t care
(May be 0 or 1)
The clocked flip-flop discussed above is a level-triggered flip-flop, which means that the
value of the output changes depending on the level of the clock. As long as the clock is HIGH, the
change in the output can happen whenever the input changes.
Edge-Triggered Flip-Flops
In edge-triggered flip-flops, the output changes only when the clock makes a transition
from one level to another. The flip-flops can be positive edge-triggered or negative edge-
triggered.
i. In positive edge-triggered flip-flops, the output responds to the 𝑆 and 𝑅 inputs only at the
positive edges of the clock pulse. At other instants of time, the output does not change.
ii. In negative edge-triggered flip-flops, the output responds to the 𝑆 and 𝑅 inputs only at
the negative edges of the clock pulse. At other instants of time, the output does not change.
Fig. 5 shows the logic symbols of edge-triggered flip-flops.
Fig. 6 Input and output waveforms for positive and negative edge-triggered RS flip-flops
Pulse Generator
A positive edge-triggered flip-flop requires a narrow positive spike to trigger it. This is
generated using a small circuit called pulse generator, as shown in Fig. 7
𝑷𝑹 𝑪𝑳𝑹 Response
0 0 Behaves as SR FF
0 1 𝑄 = 0 (clear)
1 0 𝑄 = 1 (preset)
1 1 Not used
JK Flip-Flop
An SR flip-flop can be converted to JK flip-flop by using two AND gates at the input. The
operation of a JK flip-flop is identical to that of an SR flip-flop, except that it has no forbidden
state. The circuit diagram and logic symbol of a JK flip-flop is as shown in Fig. 10.
Operation:
In the presence of clock signal, the operation can be analyzed for the following conditions:
i. If 𝑱 = 𝑲 = 𝟎
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,0,1).
So its output is 0. The inputs to the gate 2 are (1,0,0). So its output is 0.
Now 𝑆 = 𝑅 = 0. Hence output 𝑄 = 0 and 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0,1).
So its output is 0. The inputs to the gate 2 are (1,0,1). So its output is 0.
Now 𝑆 = 𝑅 = 0. Hence output 𝑄 = 1 and 𝑄̅ = 0.
That is, if 𝐽 = 𝐾 = 0, there is no change in the output.
ii. If 𝑱 = 𝟎, 𝑲 = 𝟏
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,0,1).
So its output is 0. The inputs to the gate 2 are (1,1,0). So its output is 0.
Now 𝑆 = 𝑅 = 0. Hence output 𝑄 = 0 and 𝑄̅ = 1.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,0,1).
So its output is 0. The inputs to the gate 2 are (1,1,1). So its output is 1.
Now 𝑆 = 0, 𝑅 = 1. Hence output 𝑄 = 0 and 𝑄̅ = 1.
That is, if 𝐽 = 0, 𝐾 = 1, the output is reset (𝑄 = 0).
iii. If 𝑱 = 𝟏, 𝐊 = 𝟎
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,1,1).
So its output is 1. The inputs to the gate 2 are (1,0,0). So its output is 0.
Now 𝑆 = 1, 𝑅 = 0. Hence output 𝑄 = 1 and 𝑄̅ = 0.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,1,1).
So its output is 0. The inputs to the gate 2 are (1,0,1). So its output is 0.
Now 𝑆 = 𝑅 = 0. Hence output 𝑄 = 1 and 𝑄̅ = 0.
That is, if 𝐽 = 1, 𝐾 = 0, the output is set (𝑄 = 1).
iv. If 𝑱 = 𝑲 = 𝟏
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,1,1).
So its output is 1. The inputs to the gate 2 are (1,1,0). So its output is 0.
Now 𝑆 = 1, 𝑅 = 0. Hence output 𝑄 = 1 and 𝑄̅ = 0.
Let the previous state output be 𝑄 = 1 (𝑄̅ = 0). The inputs to the gate 1 are (0,1,1).
So its output is 0. The inputs to the gate 2 are (1,1,1). So its output is 1.
Now 𝑆 = 0, 𝑅 = 1. Hence output 𝑄 = 0 and 𝑄̅ = 1.
That is, if 𝐽 = 𝐾 = 1, the output changes from 0 to 1 or 1 to 0. The output is said to
toggle.
Considering all the cases, the truth table is written as below.
Truth Table:
0 0 0 0 0 0 𝑄𝑛 No change
No change
0 0 1 1
0 1 0 Reset
0 1 0 0
Reset 1 0 1 Set
0 1 1 0
1 1 ̅̅̅̅
𝑄𝑛 Toggle
1 0 0 1
Set
1 0 1 1
1 1 0 1
Toggle
1 1 1 0
Master-Slave JK Flip-Flop
A master-slave JK flip-flop is constructed from two flip-flops. One flip-flop acts as the
master and the other serves as a slave as shown in Fig. 11.
Operation
𝑆1 and 𝑅1 are the inputs and 𝑄1 is the output of the master flip-flop. 𝑆2 and 𝑅2 are the
inputs and 𝑄2 or 𝑄 is the output of the slave flip-flop. 𝐶𝐿𝐾 is the clock pulse to the circuit.
𝐶1 = 𝐶𝐿𝐾 is the clock to master and 𝐶2 = ̅̅̅̅̅̅
𝐶𝐿𝐾 is the clock to the slave.
From the circuit, 𝑆2 is connected to 𝑄1 and 𝑅2 is connected to 𝑄̅1. So 𝑆2 = 𝑄1 and 𝑅2 = 𝑄̅1 .
This means that the input to the slave is always (0,1) or (1,0).
As the clock pulse CLK goes low, 𝐶2 = 1 and the slave translates the output of the master
to the system output 𝑄 = 𝑄2 = 𝑄1 .
As CLK goes high, 𝐶1 = 1 and the master produces the output 𝑄1 as per the 𝐽𝐾 action.
Consider the different cases:
i. If 𝑱 = 𝟎, 𝐊 = 𝟎
Let the previous state output be 𝑄 = 0 (𝑄̅ = 1). The inputs to the gate 1 are (1,0).
So its output is 0. The inputs to the gate 2 are (0,0). So its output is 0.
Shrishail Bhat, Dept. of ECE, AITM Bhatkal www.shrishailbhat.com 9
Introduction to Sequential Circuits Basic Electronics
0 0 0 0 0 0 𝑄𝑛 No change
No change
0 0 1 1
0 1 0 Reset
0 1 0 0
Reset 1 0 1 Set
0 1 1 0
1 1 ̅̅̅̅
𝑄𝑛 Toggle
1 0 0 1
Set
1 0 1 1
1 1 0 1
Toggle
1 1 1 0
D Flip-Flop
A D flip-flop is obtained from a JK flip-flop by connecting 𝐽 to 𝐾 through a NOT gate as
shown in Fig. 12.
Fig. 12 D flip-flop
When 𝐷 = 0, (𝐽, 𝐾 ) = (0,1) and hence 𝑄 = 0. When 𝐷 = 1, (𝐽, 𝐾 ) = (1,0) and hence 𝑄 =
1. The truth table is written as below.
Truth Table:
0 0 0 0 0 Reset
Reset
0 1 0
1 1 Set
1 0 1
Set
1 1 1
T Flip-Flop
A T flip-flop is obtained from a JK flip-flop by connecting 𝐽 to 𝐾 as shown in Fig. 13.
Fig. 13 T flip-flop
When 𝑇 = 0, (𝐽, 𝐾 ) = (0,0) and hence 𝑄 retains its previous state. When 𝑇 = 1,
(𝐽, 𝐾 ) = (1,1) and hence 𝑄 toggles. The truth table is written as below.
Truth Table:
0 0 0 0 𝑄𝑛 No change
No change
0 1 1
1 ̅̅̅̅
𝑄𝑛 Toggle
1 0 1
Toggle
1 1 0
Shift Register
A flip-flop can store one bit of data. When more bits of data are to be stored, a number of
flip-flops are used. A register is a set of flip-flops used to store binary data. Registers are used in
CPU (Central Processing Unit) to store data.
A register capable of shifting its stored binary information either to the right or left is
called a shift register. It consists of a set of flip-flops connected in cascade with the output of one
flip-flop connected to the input of the next one.
A 4-bit shift register employing D flip-flops is shown in Fig. 13. The bubble at the clock
input indicates that each flip-flop is trailing (negative) edge triggered.
CLK 𝑩𝟑 𝑩𝟐 𝑩𝟏 𝑩𝟎
Initial 0 0 0 0
𝐴0 0 0 0
𝐴1 𝐴0 0 0
𝐴2 𝐴1 𝐴0 0
serial-in, parallel-out simultaneously
𝐴3 𝐴2 𝐴1 𝐴0
at all outputs
X 𝐴3 𝐴2 𝐴1
X X 𝐴3 𝐴2 serial-in, serial-out at 𝐵0
X X X 𝐴3
Counter
A counter is a sequential circuit that counts the number of input pulses. A counter that
counts in terms of binary is called a binary counter. The count output of an 𝑛-bit binary counter
is 2𝑛 states and it can count from 0 to 2𝑛 − 1. The number of states of a counter is referred to as
its modulus (𝑚). For an 𝑛-bit counter, 𝑚 ≤ 2𝑛 .
Depending on the manner in which flip-flops are triggered to count, the counter are
classified into two types:
• Asynchronous counters
• Synchronous counters
In asynchronous counters, flip-flops are clocked sequentially whereas in synchronous
counters, the flip-flops are clocked simultaneously. The differences between asynchronous and
synchronous counters are listed in Table 3.
Table 3 Differences between asynchronous and synchronous counters
This process continues till the state of the counter becomes 𝑄0 𝑄1𝑄2 = 111 at the end of
seven clock pulses. At the eighth clock pulse, the counter resets to 000. Thus, the counter attains
eight states from 000 to 111 and hence it is called a mod-8 counter.
The truth table of a 3-bit ripple counter is as given below.
Truth Table:
Input
CLK 𝑸𝟐 𝑸𝟏 𝑸𝟎 Pulse
Count
Initial 0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7
0 0 0 8
Modulo-5 Counter
A mod-5 counter can be implemented using the circuit of a 3-bit counter as shown in
Fig. 16.
As 23 = 8 > 5, 3 T flip-flops are used. In a mod-5 counter, when the count reaches 5 (101
in binary), the counter resets to 000. This can be achieved by using a NAND gate. The outputs
corresponding to 1’s in 5 (101), i.e., 𝑄0 and 𝑄2 are connected to the inputs of the NAND gate and
the output of the NAND gate is connected to the CLR inputs of all the flip-flops. Thus, when the
count reaches 5, the counter resets to 000.
Synchronous Counters
In synchronous counters, the clock pulse is applied to all the flip-flops simultaneously.
Hence, they are faster than asynchronous counters.
CLK 𝑸𝟑 𝑸𝟐 𝑸𝟏 𝑸𝟎 𝑻𝟑 𝑻𝟐 𝑻𝟏 𝑻𝟎
0 0 0 0 0 0 0 0 1
1 0 0 0 1 0 0 1 1
2 0 0 1 0 0 0 0 1
3 0 0 1 1 0 1 1 1
4 0 1 0 0 0 0 0 1
5 0 1 0 1 0 0 1 1
6 0 1 1 0 0 0 0 1
7 0 1 1 1 1 1 1 1
8 1 0 0 0 0 0 0 1
9 1 0 0 1 0 0 1 1
10 1 0 1 0 0 0 0 1
11 1 0 1 1 0 1 1 1
12 1 1 0 0 0 0 0 1
13 1 1 0 1 0 0 1 1
14 1 1 1 0 0 0 0 1
15 1 1 1 1 1 1 1 1
16 0 0 0 0
Questions
1. Explain the differences between combinational and sequential circuits.
2. What is a flip-flop? Distinguish between a latch and a flip-flop.
(Jul ’19 – 2M, Jan ‘19 – 4M, Jul ‘18 – 5M, Jan ‘18 – 4M, Jul ‘17 – 4M, Jan ‘17 – 2M, Jul ‘16,
Jan ‘16, Jul ‘15 – 4M, MQP ‘14 – 4M)
3. What is a flip-flop? List out the applications of flip-flop. (Sep ’20 – 4M, Jan ‘19 – 4M)
4. With the help of a logic diagram and truth table, explain the operation of an SR flip-flop.
(Jan ‘19 – 6M, Jan ‘18 – 6M, Jul ‘17 – 8M, Jul ‘16 – 5M, Jan ‘16 – 5M, Jul ‘15 – 6M, MQP
‘15 – 6M)
5. With the help of a logic diagram and truth table, explain the working of a clocked SR flip-
flop.
(Sep ’20 – 6M, Jan ’20 – 6M, Jul ‘19 – 8M, Jan ‘19 – 7M, MQP ’18 – 6M, Jul ‘18 – 6M, Jan
‘18 – 8M, Jul ‘17 – 8M, Jan ‘17 – 8M, Jul ‘16 – 5M, Jan ‘16 – 8M, Jan ‘15 – 6M, MQP ‘15 -
4M, MQP ‘14 – 5M)
6. Explain the working of a clocked SR flip-flop with a suitable circuit, symbol, truth table
and input-output waveforms considering positive edge triggered SR flip-flop.
(Jul ‘18 – 6M)
7. With a neat circuit diagram and truth table, explain the working of a JK flip-flop.
(MQP ’18 – 6M)
8. What is a flip-flop? Explain the operation of Master Slave JK flip-flop.
(Jan ’20 – 8M, Jul ‘19 – 6M, MQP ’18 – 5M)
9. What are the differences between level-triggered and edge-triggered flip-flops?
10. What is a shift register? Explain the working of a 4-bit SISO shift register.
(MQP ’18 – 8M)
11. Draw and explain 4-bit shift register. (Feb ’21 – 6M)
12. What is a counter? What are the differences between synchronous and asynchronous
counters?
13. What is a counter? With a neat timing and block diagram, explain three-bit (Mod-8)
asynchronous (ripple) counter operation. (Jan ‘19 – 8M, MQP ’18 – 7M)
14. With a block diagram, explain the working of a 3-bit ripple(asynchronous) counter.
(Jan ‘20 – 6M, Jul ’19 – 6M)
15. With a neat block diagram, explain the operation of four-bit (Mod-16) asynchronous
(ripple) counter.
16. With a neat block diagram, explain the operation of Mod-8 synchronous counter.
17. With a neat block diagram, explain the operation of Mod-16 synchronous counter.
References
1. D. P. Kothari, I. J. Nagrath, “Basic Electronics”, McGraw Hill Education (India) Private
Limited, Second Edition, 2014.
2. John M. Yarbrough, “Digital Logic Applications and Design”, Thomson Learning, 2001.
3. Donald D. Givone, “Digital Principles and Design”, McGraw Hill, 2002.