Unit 2
Unit 2
Unit 2
1 1 0 0 0
1 1 0 1
1 1 0 0
1 1 0 0 1
4-bit ripple carry adder/Parallel adder
C3 = Cout
Working of Ripple Carry Adder /Parallel adder
• Firstly the Full Adder A adds A0 and B0 along with the carry Cin to
generate the sum S0 (the first bit of the output sum) and the carry
C0 which is connected to the next adder in chain.
• Next, the Full Adder B uses this carry bit C0 to add with the input
bits A1 and B1 to generate the sum S1(the second bit of the
output sum) and the carry C1 which is again further connected to
the next adder in chain and so on.
• The process continues till the last Full Adder D uses the carry bit
C2 to add with its input A3 and B3 to generate the last bit of the
output S3 along with last carry bit C3.
Binary Subtractor
Parallel Subtractor
Working of Parallel Subtractor
• The parallel binary subtractor is formed by combination of all full
adders with subtrahend complement input.
• This operation considers that the addition of minuend along with
the 2’s complement of the subtrahend is equal to their subtraction.
• Firstly the 1’s complement of B is obtained by the NOT gate and 1
can be added through the carry to find out the 2’s complement of
B. This is further added to A to carry out the arithmetic subtraction.
• The process continues till the last full adder uses the carry bit to
add with its input A and 2’s complement of B to generate the last
bit of the output S3 along last carry bit C4.
For Subtraction
For a>b, a=b
• If a carry is generated (C4=1) , then ignore the carry
and result will be the difference between a and b.
For a<b
• If no carry (C4=0), then the difference is 2’s
compliment of the result with negative sign
BCD to Excess-3 Conversion
25/06/2024 22
25/06/2024 23
25/06/2024 24
The final set of output equations are
W= A + BD + BC
X = B’C + B’D + BC’D’
Y = C’D’ + CD
Z = D’
25/06/2024 25
Excess-3 to BCD
Excess-3 code is also a Self complementing code
Binary to gray code conversion
Binary to gray code conversion
Gray to Binary code conversion
Gray code is also called unit distance code
1-bit comparator
2- bit comparator
3 to 8 decoder with active high outputs
Truth Table of 3:8 decoder
4x2 Encoder
8x3 Encoder
outputs
inputs
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
Binary Multiplier
8x1 mux using 4x1 mux and OR gate
8x1 mux using 4x1 mux and 2x1 mux
Multiplexer as fulladder
Flip Flops and its
application
element
state’
19EC302: Digital System Design 98
Latches
• Latch is an electronic logic circuit with two stable states.
103
SR Latch
Circuit: SET Mode
• Consider the input S = 1.
Any time the input of a NOR
gate is 1 the output is 0. So,
the output of the second
NOR gate is 0, i.e. Q’ = 0.
• Q’ = 0 is fed back into the
input of the first NOR gate.
So, with R = 0, the output of
the first NOR gate is 1, i.e.
Q=1.
104
SR Latch
Truth Table: SET Mode
105
SR Latch
Circuit: RESET Mode
• Consider the input R = 1.
Any time the input of a
NOR gate is 1 the output is
0. So, the output of the first
NOR gate is 0, i.e. Q = 0.
• Q = 0 is fed back into the
input of the second NOR
gate. So, with S = 0, the
output of the second NOR
gate is 1, i.e. Q’=1.
106
SR Latch
Truth Table: RESET Mode
107
SR Latch
Circuit: INVALID Mode
• S = 1, R = 1; This condition
tries to set and reset the
NOR gate latch at the same
time, it produces Q = Q’ =
0. This is an unexpected
condition and is not used.
• The two outputs should be
the inverse of each other.
108
SR Latch
Circuit: INVALID Mode
• If the inputs are returned
to 1 simultaneously, the
output states are
unpredictable.
• This input condition
should not be used and
when circuits are
constructed, the design
should make this condition
SET=RESET=1 never arises.
109
SR Latch
Circuit: INVALID Mode
110
R-S Latch [summary]
• Consists of two cross-coupled NOR gates.
• 2 inputs [R-Reset, S-Set] and 2 outputs []
112
S’R’ Latch
Circuit: INVALID Mode
• The analysis of a SR
Flip Flop NAND:
• S = 0, R = 0; This
condition tries to set
and reset the NAND
gate latch at the
same time.
• It produces Q = Q’ =1
113
S’R’ Latch
Circuit: INVALID Mode
• This is an unexpected condition,
since the two outputs should be
inverses of each other.
• If the inputs are returned to 1
simultaneously, the output
states are unpredictable.
• This input condition should not
be used and when circuits are
constructed, the designer should
make sure that this condition.
S=R=0 never arises.
It is called INVALID/ PROHIBITED
114
S’R’ Latch
Circuit: INVALID Mode
115
Latch
• Consists of two cross-coupled NAND gates.
• 2 active low inputs and 2 outputs []
• Assume C = 0
• If clock goes from 0-to-1 [+ve edge], all three inputs to NAND3 become 1,
• If clock goes from 0-to-1 [+ve edge], both inputs to NAND2 become 1,
• Assume C = 1
• If clock goes from 1-to-0 [-ve edge], all three inputs to NAND3 become
• If clock goes from 1-to-0 [-ve edge], both inputs to NAND2 become