16EI204 Digital Logic Circuits
16EI204 Digital Logic Circuits
16EI204 Digital Logic Circuits
SYLLABUS
COMBINATIONAL LOGICCIRCUIT
S4 S3 S2 S1 S0
0 1 0 1 0 10
0 1 0 1 1 11
0 1 1 0 0 12
0 1 1 0 1 13
0 1 1 1 0 14
0 1 1 1 1 15
1 0 0 0 0 16
1 0 0 0 1 17
1 0 0 1 0 18
BCD Adder
Whenever S4=1 (sums greater than 15)
Whenever S3=1 and either S2 or S1 or both are 1 (sums 10 to
15)
The previous table can be expressed as:
X = S4 + S3 ( S2 + S1)
So, whenever X = 1 we should add a correction of 0110 to the
sum.
Inputs:[A]=0101, [B]= 0011, Co=0
0011
0101
0 1 0 0 0
0 0
1000
1
1 0 0 0
0000
Inputs:[A]=0111, [B]= 0110, Co=0
0110
0111
0 1 1 0 1
1 1
1101
1
0 0 1 1
0110
Carry-Lookahead Adders
Carry-Lookahead Adders
This is the addition technique that eliminates the problem
due to inter stage carry delay.
The look ahead carry addition will therefore speed up the
addition process.
The carry-lookahead adder calculates one or more carry bits
before the sum, which reduces the wait time to calculate the
result of the larger-value bits of the adder.
The adder with look ahead carry needs additional hardware
but the speed of thus adder is independent of the number of
bits.
Basic Signals
Generate signal: gi = xiyi
Propagate signal: pi = xi yi
ci+1 = gi + cipi = gi + ci ti
4-bit Carry-Lookahead Adder
c4 = g3 + g2 p3 + g1 p2p3 + g0p1p2p3 + c0p0p1p2p3
c3 = g2 + g1 p2 + g0 p1p2 + c0p0p1p2
c2 = g1 + g0 p1 + c0p0p1
c1 = g0 + c0 p0
s0 = x0 y0 c0 = p0 c0 s1 = p 1 c 1
s2 = p 2 c 2 s3 = p 3 c 3
4-bit Carry-Lookahead Adder
c4 = g3 + c3p3 3 gates less
c3 = g2 + g1 p2 + g0 p1p2 + c0p0p1p2
c2 = g1 + g0 p1 + c0p0p1
c1 = g0 + c0 p0
s0 = x0 y0 c0 = p0 c0 s1 = p 1 c 1
s2 = p 2 c 2 s3 = p3 c3
4-bit Lookahead Carry Generator
Equations
ci+1 = gi + ci pi
g[i..i+3] = gi+3 + gi+2 pi+3 + gi+1 pi+2 pi+3 + gi pi+1 pi+2 pi+3
19
Decoders
W = A'.B'
Out0 W
B I0 Out1 X X = A.B'
A I1 Out2 Y Y = A'.B
Out3 Z
msb Z = A.B
Active-high outputs
A B W X Y Z
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
20
Decoders
W = (A'.B')'
Out0 W
B I0 Out1 X X = (A.B')'
A I1 Out2 Y Y = (A'.B)'
Out3 Z
msb Z = (A.B)'
Active-low outputs
A B W X Y Z
0 0 0 1 1 1
0 1 1 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0
22
Decoder with Enable
Out0 W
B I0
high-level Out1 X
enable A I1
Out2 Y
Out3 Z
Enable En
En A B W X Y Z
1 0 0 1 0 0 0
1 0 1 0 1 0 0
enabled
1 1 0 0 0 1 0
1 1 1 0 0 0 1
disabled 0 x x 0 0 0 0
23
Encoders
24
Encoders
An encoder has
2N inputs
N outputs
An encoder outputs the binary value of the selected (or active)
input.
An encoder performs the inverse operation of a decoder.
Issues
What if more than one input is active?
What if no inputs are active?
25
Encoders
D I0
C I1 Out0 Z
Out1 Y
B I2
A I3
A B C D Y Z
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
26
Priority Encoders
If more than one input is active, the higher-order input has
priority over the lower-order input.
The higher value is encoded on the output
A valid indicator, d, is included to indicate whether or not the
output is valid.
Output is invalid when no inputs are active
d=0
Output is valid when at least one input is active
d=1
27
Priority Encoders
msb
Valid bit
28
Multiplexers
29
Multiplexers
A multiplexer has
N control inputs
2N data inputs
1 output
A multiplexer routes (or connects) the selected data input to
the output.
The value of the control inputs determines the data input
that is selected.
30
Multiplexers
Data
inputs
Z = A′.I0 + A.I1
Control
input
31
Multiplexers
A B F
0 0 I0
0 1 I1
1 0 I2
1 1 I3
MSB LSB
32
Multiplexers
A B C F
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
MSB LSB
Z = A′.B'.C'.I0 + A'.B'.C.I1 + A'.B.C'.I2 + A'.B.C.I3 +
A.B'.C'.I0 + A.B'.C.I1 + A'.B.C'.I2 + A.B.C.I3
33
Multiplexers
34
Demultiplexers
35
Demultiplexers
A demultiplexer has
N control inputs
1 data input
2N outputs
A demultiplexer routes (or connects) the data input to the
selected output.
The value of the control inputs determines the output that is
selected.
A demultiplexer performs the opposite function of a
multiplexer.
36
Demultiplexers
Out0 W W = A'.B'.I
Out1 X
I In X = A.B'.I
Out2 Y
Out3 Z Y = A'.B.I
S1 S0 Z = A.B.I
A B
A B W X Y Z
0 0 I 0 0 0
0 1 0 I 0 0
1 0 0 0 I 0
1 1 0 0 0 I
37
Code converters
CODE CONVERTERS
39
BCD-to-Binary Conversion
40
Contd...
For example, 4610 is represented as
The MSB has a weight of 10, and the LSB has a weight of 1.
So the most significant 4bit group represents 40, and the least
significant 4bit group represents 6 as in Table.
41
Example :
Convert the BCD equivalent of 26 to binary.
Solution
42
FOUR BIT BINARY TO GRAY CODE
TRUTH TABLE:
CONVERTER
INPUT ( BINARY) OUTPUTS (GRAY CODE)
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
43
FOUR BIT BINARY TO GRAY CODE CONVERTER
Simplification using K-maps:
44
FOUR BIT BINARY TO GRAY CODE CONVERTER
Logic Diagram:
45
FOUR BIT GRAY CODE TO BINARY CONVERTER
Truth Table:
G3 G2 G1 G0 B3 B2 B1 B0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 1
0 1 0 1 0 1 1 0
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
1 0 0 0 1 1 1 1
1 0 0 1 1 1 1 0
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 0 1 0 1 1
1 1 1 1 1 0 1 0
46
FOUR BIT GRAY CODE TO BINARY CONVERTER
Simplification using K-Maps:
47
FOUR BIT GRAY CODE TO BINARY CONVERTER
Simplification using K-Maps:
48
FOUR BIT GRAY CODE TO BINARY CONVERTER
Logic Diagram:
49
BCD to XS 3 code converter
TRUTH TABLE FOR BCD TO XS3 CODE CONVERTER:
51
BCD to XS 3 code converter- Design (3)...
52
BCD to XS 3 code converter
53
COMPARATORS
COMPARATORS
Comparator is a combinational logic circuit that
compares the magnitudes of two binary quantities to
determine which one has the greater magnitude.
55
If two input bits are not equal, its output is a 1. But if
two input bits are equal, its output is a 0.
So exclusiveOR gate can be used as a 2bit Comparator.
56
Contd...
There are two different types of output relationship between
the two binary quantities;
Cascading Outputs
Inputs
58
It has three active-HIGH outputs
Solution: The number on the A inputs is 0110 and the number on the B inputs is 0011. The A > B output is
HIGH and the other outputs (A=B and A<B) are LOW
60
61
Magnitude Comparator
A = a3a2a1a0 B = b3b2b1b0
Xi = ai.bi + ai'.bi' = ai xnor bi (equivalence)
(A = B): X3.X2.X1.X0
(A > B): a3b3' + X3a2b2' + X3X2a1b1' + X3X2X1a0b0'
62
Magnitude Comparator
A = a3a2a1a0 B = b3b2b1b0
Xi = ai.bi + ai'.bi' = ai xnor bi (equivalence)
(A = B): X3.X2.X1.X0
(A > B): a3b3' + X3a2b2' + X3X2a1b1' + X3X2X1a0b0'
(A < B): a3'b3 + X3a2'b2 + X3X2a1'b1 + X3X2X1a0'b0
64