Professional Documents
Culture Documents
5
CHAPTER
Combinational and
Sequential Digital Circuits
Learning Objectives
After reading this chapter, you will know:
1. Arithmetic Circuits
2. Multiplexers
3. Decoders
4. Encoder
5. Demux
6. Code Converters
7. PROM’s and PLA’s
8. Latches and Flip-Flops
9. F/F Conversion
10. Counters and Shift Registers
Introduction
Digital circuits can be classified into two types
Combinational Digital Circuits
Sequential Digital Circuits
Combinational
I/P’s Digital CKT O/P’s
I/P’s O/P’s
C. D. CKT
F/F
F/F
Half Subtractor: It is a Combinational circuit that subtracts two bits and produces their
difference. It also has an output to specify if ‘1’ has been borrowed.
X Y Borrow Diff
0 0 0 0
0 1 1 1
1 0 0 1
1 1 0 0
X D Borrow =x’ y
H.S.
y B
Y Y
Y Y
info@thegateacademy.com ©Copyright reserved. Web:www.thegateacademy.com 80
Combinational and Sequential Digital Circuits
Half adder can be converted into half Subtractor with an additional inverter.
Full Adder: It performs the addition of three bits (Two Significant bits and a Pervious Carry)
and generates sum and carry.
X Y Z Carry Sum
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
X Sum
Y F. A
Z Carry
Sum = X Y Z
Carry = XY + YZ + ZX
= XY + Z(X y)
X Y Z
Sum
Carry
Full Adder can be implemented by using two half adders and an OR Gate.
X Sum
H. A. H. A.
Y
Z Carry
Sum
=XYZ
Carry
info@thegateacademy.com ©Copyright reserved. Web:www.thegateacademy.com = XY 81
+ YZ
+ ZX
Combinational and Sequential Digital Circuits
X
Y
Sum
Z
Carry
Full Subtractor: It subtracts one bit from the other by taking pervious borrow into account
and generates difference and borrow.
Truth Table of Full Subtractor
X Y Z Borrow Difference
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
X Difference
Y F. S.
Z Borrow
Diff. = X Y Z
Borrow = X′Y + YZ + X′Z
X Y Z
Difference
Borrow
Z Borrow
X
Y
Difference
Z
Borrow
Full adder can be converted into Full Subtractor with an additional inverter.
Four bit Binary parallel adder can be constructed by using three Full Adders and one half
Adder or by using four Full Adders with input carry for least significant bit Full Adder is zero.
Four bit Binary parallel adder shown in figure is also called as Ripple Carry Adder.
B3 A3 B2 A2 B1 A1 B0 A0
Cout S3 S2 S1 S0
B3 A3 B2 A2 B1 A1 B0 A0
Cout S3 S2 S1 S0
Decoder
A Decoder is a logic circuit that converts an n bit binary input code into M (=2n ) output lines
such that each output line will be activated for only one of the possible combinations of inputs.
(or)
A Decoder is a combinational circuit that converts binary information from ‘n’ input lines to a
maximum of 2n unique output lines.
E.g. 2 × 4 line Decoder (It is also called one four line decoder)
X Y
D0
X D0 = X′Y′
D1
2×4 D1 = X′Y
Y D2
D3 D2 = XY′
D3 = XY
Active low output types of decoders will give the output low for given input combination and
all other outputs are high.
X Y
X D0
D0 = X′Y′
D1
2×4 D1 = X′Y
Y D2
D3 D2 = XY′
D3 = XY
A0
D5
D6 C
D7
D0 D4
B A1 D1 D5
C A0 D 2 D6
EN D 3 D7
Demultiplexer
A Decoder with enable input, acts as “Demultiplexer.” A Demultiplexer is a circuit that receives
information on a single line and transmits that information on one of 2n possible output lines.
The selection of specific output line is controlled by the bit values of ‘n’ selection lines.
E A B 𝐃𝟎 𝐃𝟏 𝐃𝟐 𝐃𝟑
1 X X 0 0 0 0
0 0 0 1 0 0 0
0 0 1 0 1 0 0
0 1 0 0 0 1 0
0 1 1 0 0 0 1
D0
D1
E 1×4
D2
D3
A B
Multiplexer
Multiplexing means transmitting a large number of information units over a smaller number of
channel lines. “A Digital multiplexer is a combinational circuit that selects Binary information
from one of many inputs lines and direct it a to single output line. The selection of a particular
lines is controlled by a set of selection lines. Normally, there are 2n input lines and ‘n’ selection
lines whose bit combinations determine which input is selected.”
I0
I1
4×1 Y
I2 MUX
I3
S1 S0
𝐒𝟏 𝐒𝟎 𝐘
0 0 I0
0 1 I1
1 0 I2
1 1 I3
A B C F
0 0 0 0
0 0 1 1 C I0
C I1
0 1 0 0 Y
0 1 1 1 C I2
C I3
1 0 0 0 S1 S0
1 0 1 1
1 1 0 1 A B
1 1 1 0 A
F = ∑(1, 3, 5, 6)
When AB = 00, F is equal to C, similarly for all other combinations of AB, input to mux
is defined in terms of C.
MUX circuit or IC’s may have an enable input to control operation of the unit. When it is input
is in a given Binary state the output is disabled and when in the other state the circuit
functions as a normal Multiplexer.
The MUX is a very useful MSI function and has a multitude of applications
It is used for connecting two or more sources to a single destination among computer units
and it is useful for constructing a common bus system.
I0 2 : 1
0
MUX Y
1 I1 S
2. NOT-Gate/Inverter : Y = A
I0
1 2:1
MUX Y
0 I1 S
3. AND-Gate : Y = AB
0 I0
2:1
MUX Y
B I1 S
4. OR-Gate : Y = A + B
B I0 2 : 1
MUX Y
1 I1 S
5. NOR-Gate : Y = A + B
̅
B I0 2 : 1
MUX Y
0 I1 S
6. NAND-Gate : Y = AB
1 I0 2 : 1
MUX Y
̅
B I1 S
7. EX-OR-Gate : Y = A ⊕ B = AB + AB
B I0 2 : 1
MUX Y
̅
B I1 S
8. EX-NOR Gate : Y = A ⊙ B = AB + A B
̅
B I0
2:1
MUX Y
B I1 S
Example: The Boolean function implemented in the figure using two input multiplexers is
C 0
0 0
f
̅
C A
1 1
B E
̅C + ABC̅
(A) AB (C) ̅ BC + A
A ̅B̅C̅
(B) ABC + AB ̅C̅ (D) ̅̅̅̅
ABC + A̅ BC̅
Solution: From the figure we have
E = output of 1st MUX
=B⨁C=B ̅C + BC̅
And f=̅ E 0 + E A = EA
f = AB̅C + ABC̅
Example: How many minimum number of 2 : 1 MUX required for implement the Half Adder
(H.A)
(A) 2 (C) 4
(B) 3 (D) None of these
Solution: We know, H.A a SUM = A ⊕ B and a carry A and B are the two input variable i.e.,
A Sum= A⨁B
H.A
B Carry = AB
⇒ For carry we required an AND-Gate as
0 I0 2 : 1
MUX Carry=AB
B I1 S
A
⇒ For SUM we required an EX-OR Gate as
B I0 2 : 1
MUX Sum = A⨁B
̅
B I1 S
A
B as input is not available, so we require an inverter circuit also as
1 I0 2 : 1
MUX B
0 I1 S
B
Finally, to implement a H.A. we required 3, 2 : 1MUX
[For SUM ⇒ 2 and Carry ⇒ ×1]
Example: What are the minimum number of 2 to 1 multiplexers required to generate a 2-input
AND Gate and a 2-input Ex-OR Gate?
(A) 1 and 2 (C) 1 and 1
(B) 1 and 3 (D) 2 and 2
Solution: [Ans. A]
For AND Gate ⇒ 2:1 MUX required = 1 and for EX-OR Gate ⇒ 2 : 1 MUX required = 2.
Implementation Table
I0 I1 I2 I3 I4 I5 I6 I7
̅ 0 0 ① 2 ③ ④ 5 6 7
A
A 1 8 9 10 ⑪ ⑫ ⑬ ⑭ ⑮
0 ̅ 0 1 1 A A A
A
Given multiplexer is 8:1
Number of input lines 8(I0 , I1 , I2 , I3 , I4 , I5 , I6 , I7 )
Logic Diagram:
0
B C D
I0
̅
A I1
I2
1 I3 8:1 y
I4 MUX
I5 MUX
A I6 MUX
I7
A I0
I1
I2
I3 8:1
F
1 I4 MUX
I5
I6
0 I7
Logic Diagram:
0 B C D
I0
A′ I1
I2
I3 8:1 F
I4 MUX
A I5
I6
1 I7
Logic Diagram:
I0
I1
I2
I3 8:1
F
MUX
I4
A
I5
I6
I7
0
Encoder: A decoder identifies a particular code present at the input terminals of the circuit.
The inverse process is called “Encoding.”An Encoder has number of inputs (2n ), one and only
one of which is in the high state or active and an n-bit code is generated upon which of the
inputs is excited.
Sequential Circuits
Two cross coupled inverters will form a basic latch which can store one bit of information.
Flip-Flops: Flip-Flop is also called “Bistable Multivibrator”. It can store one bit of information.
In a Flip-Flop one output is always complement of the other output.
Flip-Flop has two stable states.
Flip Flops
Clocked S-R Flip-Flop: It is called set reset Flip-Flop.
𝐒𝐧 𝐑𝐧 𝐐𝐧+𝟏
0 0 Qn
0 1 0
1 0 1
1 1 ∗
Q n+1 = SQn + RQ n
PRESET
Set N3
N1 Q
CLK
Reset N2 N4 Q′
CLEAR
N1 And N2 Form a basic latch, N3 and N4 are called Steering Gates or Control Gates, because
they are used to control the output.
S and R inputs are called “synchronous inputs”. Preset (Pr) and Clear (Cr) inputs are called
“Direct inputs or asynchronous inputs”.
The output of the Flip-Flop changes only during the clock pulse. In a Clock duration the
output of the Flip-Flop does not change.
During normal operation of the Flip-Flop, preset and clear inputs must be always high.
The disadvantage of S-R Flip-Flop is for S=1, R=1 output cannot be determined. This is
eliminated in J-K Flip-Flop.
S-R Flip Flop can be converted to J-K Flip-Flop by using the two equation S=JQ′ and R= KQ.
Truth Table
Jn Kn Q n+1
0 0 Qn
0 1 0
1 0 1
1 1 Q′n
Q n+1 = JQ′n + K ′ Q n
R Q′
Q Cr K Q′
K
Race Around Condition is present in the J-K Flip Flop, when both J=K=1.
Toggling the output more than one during the clock pulse is called “Race Around Problem”.
The race around problem in J-K Flip-Flop can be eliminated by using edge triggered Flip-Flop
or master slave J-K Flip Flop or by the clock signal whose pulse width is less than or equal to
the propagation delay of Flip-Flop.
Master-slave flip-flop is a cascading of two J-K Flip-Flops. Positive or direct clock pulses are
applied to master and inverted clock pulses are applied to the slave flip-flop.
D
J D
Q Q
CLK CLK
K Q′ Q′
D Flip-Flop is used to provide delay. The bit on the input D line is transferred to the output in
the next clock pulse.
T Flip-Flop: J−K Flip-Flop can be converted into T- Flip-Flop by connecting J and K input
terminals to a common point. If T=1, then Q n+1 = ̅̅̅̅
Q n . This unit changes state of the output with
each clock pulse and hence it acts as a toggle switch.
Truth Table
T Q n +1
0 Qn
1 Qn
Q n +1 = TQ′n + T ′ Q n = T Q n
If X kHz clock signal is applied to a T Flip-Flop when T=1, then the output (Q) signal
frequency is given by X/2kHz. Thus it acts as a frequency divider.
Excitation Table:
Qn Qn + 1 S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
Qn Qn + 1 J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
Qn Qn + 1 D
0 0 0
0 1 1
1 0 0
1 1 1
Qn Qn + 1 T
0 0 0
0 1 1
1 0 1
1 1 0
Setup Time (𝐭 𝐬 ): Time interval immediately preceding the active transition of clock signal during
which the control input must be maintained at the proper level.
Hold Time (𝐭 𝐇): The time interval immediately following the active transition of the clock signal
during which the synchronous control input must be maintained at the proper level.
D D D Q D Q
C C CLK ̅ ̅
CLK Q
Q
(Positive Edge) (Negative Edge) (+Ve Level) (−Ve Level)
Conversion Equations:
JK → T JK → T JK → D D → JK D→T D → SR
Conversion Table:
J K Q n Q n+1 T
0 0 0 0 0
info@thegateacademy.com ©Copyright reserved. Web:www.thegateacademy.com 97
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 1
1 0 1 1 0
1 1 0 1 1
1 1 1 0 1
KQ n
T 00 01 11 10
J 0
0 0 1 0
1 1 0 1 1
̅ nJ
T = KQ n + JK + Q
T→D
D Q n Q n+1
0 0 0
0 1 0
1 0 1
1 1 1
Qn Q n+1 T
0 0 0
0 1 1
1 0 1
1 1 0
D T Q
̅
Q
Check
D=0 T = Q n Q n+1 = 0
D=1 T=Q ̅ n Q n+1 = 1
K
T Q
̅
Q
J
Check
J=K=0 →T=0 → Q n+1 = Q n
J = 1, K = 0 →T=Q ̅n Q n+1 = 1
J = 0, K = 1 → T = Qn Q n+1 = 0
Required
D Qn Q n+1 T
0 0 0 0
0 1 0 1
1 0 1 1
1 1 1 0
Qn
D 0 1
0 0 1
1 1 0
̅ n = D ⊕ Qn
̅ + DQ
T = Qn D
1 0 1 0 = 10
Shift left by n – positions is equivalent to multiplication by 2n .
If least significant bit = 0, then Right Shift operation by one position is same as Division by 2.
E.g.: Q 3 Q 2 Q1 Q 0
1 0 1 0 =1
0
0 1 0 1 =5
If L.S.B = 1, then Right Shift operation gives integer division by 2.
E.g.: Q 3 Q 2 Q1 Q 0
0 1 0 1 =5
0
0 1 0 =2 (Instead of 2.5)
Ring Counter: Shift register can be used as ring counter when Q0 output terminal is connected
to serial input terminal.
An n-bit ring counter can have “n” different output states. It can count n-clock pulses.
Ring Counter
Q2 Q1
D Q D Q D Q
D D Q0
D
CLK
001 100 010
Q2 Q1 Q0
D Q D Q D Q
D D D
CLK
001 011
Counters
The Counter is driven by a clock signal and can be used to count the number of clock cycles.
Counter is nothing but a frequency divider circuit.
Two types of counters are available:
1. Synchronous 2. Asynchronous
Synchronous counters are also called “Parallel Counters”. In this type clock pulses are applied
simultaneously to all the Flip-Flops.
Asynchronous counters are also called “Ripple or Serial Counters”. In this type of counters the
output of one Flip-Flop is connected to the clock input of next Flip-Flop and so on.
Ripple Counter (Asynchronous):
Q0 Q1 Q2
1 D 1 D 1 D
J Q J Q J Q
CLK
X
̅
Q
Design of FSM
Here is an example of a designing a finite state machine, worked out from start to finish.
Step 1: Describe the machine in words.
In this example, we’ll be designing a controller for an elevator. The elevator can be at one of two
floors: Ground or First. There is one button that controls the elevator, and it has two values. Up
or Down. Also, there are two lights in the elevator that indicate the current floor. Red for Ground,
and Green for First. At each time step, the controller checks the current floor and current input,
changes floors and lights in the obvious way.
In this diagram, the bubbles represent the states, and the arrows represent state transitions.
The arrow labels indicate the input value corresponding to the transition. For instance, when
Step 3: Select numbers to represent states and values. Before converting the above FSM diagram
to a circuit, we need to represent every value in our example as a binary number. Here is some
convenient numbers to use.
Ground = 0 Down = 0 Off = 0
First = 1 Up = 1 On = 1
E.g.: Design a sequence detector that produces ‘1’ when three ones appear sequentially at the
input.
1/0 1/0
0/0
S1 S2 S3
0/0
0/0
1/1
The state machines are modelled using two basic types of sequential networks - Mealy and
Moore. In a Mealy machine, the output depends on both the present (current) state and the
present (current) inputs. In Moore machine, the output depends only on the present state.
Mealy FSM
A general model of a Mealy sequential machine consists of a combinatorial network, which
generates the outputs and the next state, and a state register which holds the present state as
shown below. The state register is normally modelled as D flip-flops. The state register must be
sensitive to a clock edge. The other block(s) can be modelled either using the always procedural
block or a mixture of the always procedural block and dataflow modelling statements; the
always procedural block will have to be sensitive to all inputs being read into the block and must
have all output defined for every branch in order to model it as a combinatorial block. The two
blocks Mealy machine can be viewed as
Moore FSM
A general model of a Moore sequential machine is shown below. Its output is generated from the
state register block. The next state is determined using the present (current) input and the
present (current) state. Here the state register is also modelled using D flip-flops. Normally
Moore machines are described using three blocks, one of which must be a sequential and the
Example: The state transition diagram for the logic circuit shown is
2-1 MUX
D Q X1
Y
CLK Q X0
Select
A
A=1 A=0 A=0 A=0
A=1 A=1
(A) (B)
Q=0 A=0 Q=1 Q=0 A=1 Q=1
In this example, we have a D-Flip-flop with output Q and a 2×1 multiplexer with
selection line A. Now, if A=0, then Y=X0 and for A=1 then Y=X1 is selected.
From the options, Q has two values 0 and 1 respectively.
For Q=1, then Q̅ = 0.
If A = 0 then Y = X0 = Q ̅ = 0, Now next state is Q = 0
If A = 1 then Y = X1 = Q = 1, Now next state is Q = 1 which means same state
For Q = 0, then Q̅=1
If A = 0 then Y = X0 = Q ̅ = 1, Now next state is Q = 1
If A = 1 then Y = X1 = Q = 1, Now next state is Q = 0 which means same state
So, the Answer is Option D
Example: The digital logic shown in the figure satisfies the given state diagram when Q1 is
connected to input A of the XOR gate. Suppose the XOR gate is replaced by the XNOR
gate. Which one of the following options preserves the state diagram? Suppose the
XOR gate is replaced by an XNOR gate. Which one of the following options preserves
the state diagram?
(A) Input A is connected to Q2
(B) Input A is connected to Q2
(C) Input A is connected to Q1 and S is complemented
(D) Input A is connected to Q1
S=1
A 00 01
D1 Q1 D1 Q1
S=0
S=1 S=1
S S=0
Q1 Q2
CLK
10 11
S=1
S=0
Solution: [Ans. D]
The input of D2 flip-flop is
D2 = Qi s + Q i s(∵ A = Q i )
The alternate expression for EX-NOR gate is =A ⊕ B = A ⊕ B = A ⊕ B
So, if the Ex-OR gate is substituted by Ex-NOR gate input A should be connected to Qi
D2 = Qi S + Q i s = Qi S + Qi S (∵ A = Qi )
= Q i S + Qi S