Digital Electronics
Digital Electronics
Digital Electronics
NUMBER SYSTEM
Electronics - I, The LNM Institute of
Information Technology, Jaipur
Numbers
(2007)8 2 83 0 82 0 81 7 80
What decimal number does it represent?
Symbol
10
11
12
13
14
15
21
22
(1101) 2 1 23 1 2 2 0 21 1 20
(1101) 2 1 8 1 4 0 21 1 20 13
1101.1001
23
2
-1
0.5
-2
0.25
-4
22
21
20
-2
2-1 2 2-3
0.125
0.0625
0.03125 0.015625
-3
-4
-5
-6
24
16
25
32
26
64
27
128
28
256
29
512
210
1024(K)
220
1048576(M)
25
1100001 = ?
64+32+1=97
0.101 = ?
0.5+0.125=0.625
11.001 = ?
3+0.125=3.125
45
22.5 bn 2n 1 bn 1 2n 2.......b1 20 b0 0.5
2
22 0.5 bn 2n 1 bn 1 2n 2....... b1 20 b0 0.5
b0 1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
b0 1
22 bn 2n 1 bn 1 2 n 2.......b2 21 b1 20
Divide both sides by 2
22
11 bn 2n 2 bn 1 2n 3.......b2 20 b1 0.5
2
b1 0
11 bn 2n 2 bn 1 2n 3...... b3 21 b2 20
5.5 bn 2n 3 bn 1 2n 4...... b3 20 0.5b2
b2 1
5 bn 2n 3 bn 1 2n 4......b4 21 b3 20
Electronics - I, The LNM Institute of
Information Technology, Jaipur
5 bn 2n 3 bn 1 2n 4......b4 21 b3 20
2.5 bn 2n 4 bn 1 2 n 5......b4 20 0.5b3
b3 1
2 bn 2n 4 bn 1 2 n 5......b5 21 b4 20
1 bn 2n 5 bn 1 2n 6......b5 20 0.5b4
b4 0
b5 1
(45)10 b5b4b3b2b1b0 101101
remainder
22
11
45
101101
10
b0
153
b0
n 1
n2
0
0.125 b0 1
19.125 bn 8 bn 18 .......b1 8
8
8
8
153
remainder
19
153
(231)8
11
0.7 b1 b2 21 .......b n 2 n 1
b1 0
0.7 b2 21 b3 22 .......b n 2 n 1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
12
0.7 b2 21 b3 22 .......b n 2 n 1
Multiply both sides by 2
1.4 b2 b3 21 .......b n 2 n 2
Note that +1/4+1/8+1
b2 1
0.4 b3 21 b4 2 2.......b n 2 n 2
0.8 b3 b4 2 1.......b n 2 n 3
b3 0
13
0.125
(.001)2
0.
25
0.
1.
0 .
0.8125 = ?
0.8125
125
(.1101)2
x2
x2
x2
8125
1.
625
1.
25
0.
1.
x2
x2
x2
x2
14
Binary numbers
Most significant bit or MSB
1011000111
decimal
2bit
3bit
4bit
5bit
00
000
0000
00000
01
001
0001
00001
10
010
0010
00010
11
011
0011
00011
100
0100
00100
101
0101
00101
110
0110
00110
111
0111
00111
1000
01000
1001
01001
10
1010
01010
11
1011
01011
Least significant
bit or LSB
This is a 10 bit number
Binary digit = bit
15
Number
Symb
ol
0(0000)
1(0001)
2(0010)
3(0011)
4(0100)
5(0101)
6(0110)
7(0111)
8(1000)
9(1001)
10(1010)
11(1011)
12(1100)
13(1101)
14(1110)
15(1111)
b7 27 b6 26 b5 25 b4 24 b3 23 b2 22 b1 21 b0 h1161 h0
(b7 23 b6 22 b5 21 b4 )24 (b3 23 b2 2 2 b1 21 b0 ) h1161 h0
h1
h0
16
Binary Addition/Subtraction
1
1 0
1 1
101
1101
110
+ 1110
1011
11011
17
Complement of a number
9s complement
Decimal system:
10s complement
9s complement of n-digit number x is 10n -1 -x
10s complement of n-digit number x is 10n -x
9s complement of 85 ?
102 1 85
99 85 14
18
24 1 1011
0110010
Electronics - I, The LNM Institute of
Information Technology, Jaipur
19
001110
1011 0101
101101100 010010100
20
Adder
x2
S
CY
x1
Y = S if Sign = 0
Y = 2's Complement of S if Sign = 1
Adder
x2
2's Complement
CY
Sign
Sign = 0 for psotive numbers
= 1 for negative numbers
2 x2
N
(CY , S ) x1 2 N x2
21
x1
Y = S if Sign = 0
Y = 2's Complement of S if Sign = 1
Adder
x2
CY
2's Complement
Sign
Sign = 0 for psotive numbers
= 1 for negative numbers
2 N x2
(CY , S ) x1 2 N x2
A zero carry implies a negative number whose magnitude (x2 x1) can be found
as follows:
S x 2N x
1
2'scomplement of S 2 N ( x1 2 N x2 ) x2 x1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
22
Example
10
0100
S
x1=1010
0100
Y = S if Sign = 0
Y = 2's Complement of S if Sign = 1
Adder
x2=0110
2's Complement
CY
Sign
Sign = 0 for psotive numbers
= 1 for negative numbers
1010
1010
+1010
10100
23
Example
6
1100
S
x1=0110
0100
Y = S if Sign = 0
Y = 2's Complement of S if Sign = 1
Adder
x2=1010
2's Complement
10
CY
Sign
Sign = 0 for psotive numbers
= 1 for negative numbers
0110
0110
+0110
1100
It makes sense to use adder as a subtractor as well provided additional circuit
required for carrying out 2s complement is simple
Electronics - I, The LNM Institute of
Information Technology, Jaipur
24
x1
5
Y = S if Sign = 0
Y = 10's Complement of S if Sign = 1
Adder
10's Complement
x2
10-3=7
CY
Sign
25
Signed
Magnitude
decimal
Signed 1s
complement
0000
0000
0001
0001
Signed 2s
complemen
t
0000
0010
0010
0001
0011
0011
0010
0100
0100
0011
0101
0101
0100
0110
0110
0101
0111
0111
0110
-0
1000
-0
1111
1001
1110
0111
-1
-1
1010
1101
1111
-2
-2
-1
1110
1011
1100
-2
-3
-3
1101
1100
1011
-3
-4
-4
-5
1010
-4
1100
-5
1101
-6
1001
-5
1011
-6
1110
-7
1000
-6
1010
-7
1111
-7
1001
decimal
26
x1
Y = S if Sign = 0
Y = 2's Complement of S if Sign = 1
Adder
x2
CY
2's Complement
Sign
Sign = 0 for psotive numbers
= 1 for negative numbers
S
x1
Answer is in 2s
complement form
Adder
x2
CY
27
Example
S
x1
Adder
CY
x2
+5
+2
+7
-5
+2
-3
0101
+0010
0111
1011
+0010
1101
2s complement is 0011 =
+5
-2
+3
-5
-2
-7
0101
+1110
0011
1011
+1110
1001
28
2s complement is 0111 = 7
BOOLEAN ALGEBRA
Electronics - I, The LNM Institute of
Information Technology, Jaipur
29
Boolean Algebra
False
0
No
Low voltage
Basic operations:
AND:
True
y = x1 . x 2
Yes
High voltage
x1 x2 y
Truth Table
0 0 0
0 1 0
1 0 0
1 1 1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
30
Basic operations:
OR: y = x1 + x 2
Y is 1 if either x1 and x2 is 1. Or y= 0 if and only if both variables are zero
x1 x2 y
0
0
1
1
NOT:
y= x
0
1
0
1
0
1
1
1
x
0 1
1 0
Electronics - I, The LNM Institute of
Information Technology, Jaipur
31
Boolean Algebra
Basic Postulates
P1: x + 0 = x
P2: x + y = y + x
P3: x.(y+z) = x.y+x.z
P1: x . 1 = x
P2: x . y = y . x
P3: x+y.z = (x+y).(x+z)
P4: x + x = 1
P4: x . x = 0
Basic Theorems
T1: x + x = x
T1: x . x = x
T2: x + 1 = 1
T2: x . 0 = 0
T3: ( x ) = x
T5
T6:
x.( x+y) = x
32
Proving theorems
P1: x + 0 = x
P2: x + y = y + x
P1: x . 1 = x
P4: x + x = 1
P4: x . x = 0
Prove T1: x + x = x
x + x = (x+x). 1 (P1)
= (x+x). (x+x)
= x + x.x
=x+0
=x
P2: x . y = y . x
Prove T1: x . x = x
x . x = x.x+ 0 (P1)
(P4)
(P3)
= x.x + x.x
(P4)
= x . (x+x ) (P3)
(P4)
=x.1
(P1)
=x
(P4)
(P1)
33
Proving theorems
P1: x + 0 = x
P2: x + y = y + x
P1:
x.1=x
P2:
x .y = y.x
P3:
x+y.z = (x+y).(x+z)
P4: x + x = 1
P4:
x. x =0
Prove : x + 1 = 1
x + 1 = x+(x+ x)
= (x+x)+ x
=x+x
x + x .y = x
= x . 1 + x. y
= x. (1+ y)
=x.1
=x
x + x .y = x+y
= (x + x ). (x+ y)
= 1. (x+ y)
=x+y
=1
DeMorgans theorem
(x1 x 2 x 3 ....) x1 . x 2 .x 3 .
(x1. x 2 . x 3 .....) ( x1 + x 2 x 3 +.....)
Electronics - I, The LNM Institute of
Information Technology, Jaipur
34
(x1 x 2 x 3 ....) x1 . x 2 .x 3 .
(x1.x 2 x 2 .x 3 ) ?
(x1 x 2 ) . (x 2 + x 3 )
x1 . x 2 x1 . x 3 x 2 . x 3
35
x1 x2 y
y = x2
0
0
1
1
0
1
0
1
0
1
0
0
Y = 1 when x1 is 0 and x2 is 1
y = x1 . x2
Boolean expression
36
x1 x2 y
0
0
1
1
0
1
0
1
x1 x2 y
y = x1 . x2
1
0
0
0
x1 x2 y
0
0
1
1
0
1
0
1
1
0
0
1
0
0
1
1
0
1
0
1
0
0
1
0
y = x1 . x2
x1 . x2
y = x1 . x2 x1. x2
x1 . x2
Electronics - I, The LNM Institute of
Information Technology, Jaipur
37
x1 x2 y
0
0
1
1
0
1
0
1
0
1
1
0
y = x1 . x2 x1. x2
x1 x2 y
0
0
1
1
0
1
0
1
1
1
1
0
y = x1 . x2 x1 . x2 x1. x2
y = x1 x2
Electronics - I, The LNM Institute of
Information Technology, Jaipur
38
x1 x2 y
x1 x2 y
0
0
1
1
0
0
1
1
0
1
0
1
1
0
1
1
y =x1 x2
x1 x2 y
0
0
1
1
0
1
0
1
0
1
1
0
0
1
0
1
0
1
1
1
y =x1 x2
x1 x2
y = (x1 x2 ).( x1 x2 )
x1 x2
39
x1 x2 x3 y
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
40
IMPLEMENTATION OF
BOOLEAN EXPRESSIONS
Electronics - I, The LNM Institute of
Information Technology, Jaipur
41
Elementary Gates
AND:
y = x1 . x 2
x1
AND
x2
x1
y=0
AND
Gate is closed
OR:
y = x1 + x 2
NOT:
y= x
AND
y = x1
Gate is open
x1
x2
OR
y
42
x1
NAND: y = x1. x 2
x2
x1
x2
NOR: y = x1 + x 2
x1x2
NAND
x1
x2
x1
x2
x1x2
AND
x1+x2
x1+x2
OR
NOR
43
x1 x2 y
y = x1 x 2 =x1. x2 x1 . x2
XOR:
x1x2
0
0
1
1
0
1
0
1
0
1
1
0
x2
y
x1
x2
XNOR:
x1
x2
XOR
x1x2
y =x1 e x 2 = x1. x2 x1 . x2
x1
x2
XNOR
y =x1 e x 2 =x1 x2
Electronics - I, The LNM Institute of
Information Technology, Jaipur
44
AND: y =
OR: y = x1 + x 2 x3 ....
x1
x2
x3
45
C x. y x.z y.z
y
z
x
y
x
x y z
z
y
z
x y z
z
S
x
y
y
z
x y z
x
y
z
x y z
46
x
SN
x
SP
We have seen earlier (in class 12) that transistors act as switches !
Electronics - I, The LNM Institute of
Information Technology, Jaipur
47
SN
SP
VDD = 5V
closed
SP
x
LOW
HIGH
1
0
SN
open
NOT gate
48
NAND Gate
NAND:
y = x1 . x 2
VDD = 5V
x1
SP
x2
SP
x1
y
x1
LOW
x2
LOW HIGH
x2
SN
49
NOR Gate
NOR: y = x1 + x 2
VDD = 5V
x1
x1
SP
LOW
x2
x2
LOW HIGH
HIGH LOW
LOW
SN
x2
SN
50
Design Overview
a
b
c
Full Adder
a b
c S CY
0 0 0 0 0
0 0 1 1 0
CY
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
C x. y x.z y.z
1 1 1 1 1
VDD = 5V
x
y
S
x y z
z
x
x y z
x1
x2
y
z
x2
SP
SP
y
x y z
SP
x1
x y z
SN
SN
SN
51
52
y f1
y min term
0
0
1
1
0
1
0
1
0
0
1
1
0
1
0
1
0
1
1
0
f1 = m1 m2
f1 = x . y x. y
f 2 = (0, 2,3) ?
x.y
x.y
x.y
x.y
m0
m1
m2
m3
f1 = (1, 2)
f 2 = x . y x. y x . y
53
y z min terms
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
m0
m1
m2
m3
m4
m5
m6
m7
f 2 = (1, 4, 7) ?
f 2 = x . y. z x. y. z x . y . z
Electronics - I, The LNM Institute of
Information Technology, Jaipur
54
y f1
0
0
1
1
0
1
0
1
0
0
1
1
0
1
1
0
F1 = (x+y)(x + y)
= M0.M3
y Max term
0
1
0
1
x+y
x+y
x+y
x+y
M0
M1
M2
M3
= M0M3
55
x
0
0
0
0
1
1
1
1
y z Max. terms
0
0
1
1
0
0
1
1
0 x + y + z M0
1 x + y + z M1
0 x + y + z M2
1 x + y + z M3
0 x + y + z M4
1 x + y + z M5
0 x + y + z M6
1 x + y + z M7
f1 = (1,5, 7) ?
f 2 = (x y z ).( x y z ).( x y z )
Electronics - I, The LNM Institute of
Information Technology, Jaipur
56
x1 x2 x3 y
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
y= (1,3,5, 7)
y = x1 . x2 . x3 x1. x2 . x3 x1. x2 . x3 x1. x2 . x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
57
Goal of Simplification
x1
x2
x3
x1
x2
x3
58
y = x1 . x3 x1. x2 . x3 x1. x2 . x3
x1
x2
x1
x3
x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
This circuit is simpler not just because it uses 4 gates instead of 5 but also
because circuit-2 uses one 2-input and three 3-input gates as compared to five
3-input gates used in circuit-1
59
Goal of Simplification
In the SOP expression:
Simplification Minimization
60
Minimization
y = x3
Principle used: x + x = 1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
61
f = x . y x. y x . y
Apply the Principle: x + x = 1 to simplify
f = x .( y y ) x . y
f = x x. y
f = x . y x. y x . y x . y x . y x. y x . y
Principle used : x + x = x
f = x . y x. y x . y x . y
x . ( y y ) ( x x). y x y
Electronics - I, The LNM Institute of
Information Technology, Jaipur
62
Simplify
Principle: x + x = 1 and x + x = x
Need a systematic and simpler method for applying these two principles
63
KARNAUGH MAPS
Electronics - I, The LNM Institute of
Information Technology, Jaipur
64
x
0
0
1
1
y min term
0
1
0
1
x.y
x.y
x.y
x.y
y f1
0
0
1
1
0
1
0
1
0
1
1
0
m0
m1
m2
m3
y
x
0
m0
m1
m2
m3
x
0
65
f 2 = (0, 2,3)
y
x
0
f = x .y x . y
66
y z min terms
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
x
0
0
0
0
1
1
1
1
0
1
0
1
0
1
0
1
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
x.y.z
y z
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
m0
m1
m2
m3
m4
m5
m6
m7
yz
01
11
10
m0
m1
m3
m2
m4
m5
m7
m6
f
0
1
0
1
0
1
0
1
00
yz
00
01
11
10
67
yz
00
01
11
10
f = x.y . z x. y . z x. y . z x. y . z
68
z min terms
0 0 0 0
m0
0 0 0 1
m1
0 0 1 0
m2
0 0 1 1
m3
1 1 1 0
m14
1 1 1 1
m15
yz
wx 00
00 1
01
11
10
01
11
10
yz
wx 00
00 0
01
11
10
01
11
12
13
15
14
10
11
10
f =w. x . y . z w. x . y . z w. x . y . z w. x . y . z
w . x . y . z w . x . y. z w . x . y . z
Electronics - I, The LNM Institute of
Information Technology, Jaipur
69
f 2 = (2,3)
f = x. y x . y
y
x
0
f = x.( y y )
f= x
Combine terms which differ in only one bit position. As a result,
whatever is common remains.
70
y
x
0
y
x
0
f = x. y x . y
f=y
f = ( x. x). y
x
0
f=y
f =x
71
y
x
0
f = x. y x . y x . y
f = x.( y y ) x . y
x x. y
f = x x. y x. y
x ( x x). y
x y
The idea is to cover all the 1s with as few and as simple terms as possible
Electronics - I, The LNM Institute of
Information Technology, Jaipur
72
3-variable minimization
yz
00
01
11
10
f = x .y . z x . y . z x . y . z x . y . z
y. z
x. z
f = x .y . z y . z x . z
73
3-variable minimization
yz
00
01
11
10
f = x .y . z x . y . z x . y . z x . y . z
x. z
x. z
f = x . z x. z
74
3-variable minimization
yz
00
01
11
10
f = x. y . z x . y . z x . y . z x . y . z
f =x . y x . y
x. y
x. y
x
yz
00
01
11
10
f =x .( y y ) x
75
yz
00
01
11
10
yz
00
01
11
10
00
01
11
10
00
01
11
10
yz
yz
f =x z
Electronics - I, The LNM Institute of
Information Technology, Jaipur
x
76
Can we do this ?
yz
00
01
11
10
Note that each encirclement should represent a single product term. In this
case it does not.
f =x . y. z x. y.z x. y.z
x . y x.z
77
yz
00
01
10
11
f =x . y. z x. y.z
x .( y. z y.z )
Note that no simplification is possible.
Kmap requires information to be represented
Electronics - I, The LNM Institute of
Information Technology, Jaipur
78
yz
00
01
10
11
These two terms can be combined into a single term but it is not easy to
show that on the diagram.
f = x . y. z x. y.z
x .( y y ).z x.z
Kmap requires information to be represented in such a way that it is easy
to apply the principle
x x1
Electronics - I, The LNM Institute of
Information Technology, Jaipur
79
4-variable minimization
yz
wx 00
00 1
01
11
10
01
11
10
w. y . z
w. x . z
w. y . z
f = w . y. z w . x. z w . y. z w . x . y. z w . x . y. z
But is this the simplest expression ?
Electronics - I, The LNM Institute of
Information Technology, Jaipur
80
yz
wx 00
00 1
01
11
10
yz
wx 00
00 1
01
11
10
01
01
11
11
10
10
w. x . y . z w. x . y . z w. x . z
w. x . y . z w. x . y . z x . y . z
81
4-variable minimization
yz
wx 00
00 1
x. y. z
01
11
10
01
11
10
w. y . z
w. x . z
w. x . z
w. y . z
f = w . y. z w . x. z w . y. z w . x . z x . y. z
Is this the best that we can do ?
Electronics - I, The LNM Institute of
Information Technology, Jaipur
82
yz
wx 00
00 1
01
11
10
yz
wx 00
00 1
01
11
10
01
01
11
11
10
10
f = w . y. z w . x. z
f = w . y. z w . x. z
w . y. z w . x . z x . y. z
w . x . z x . y. z
83
4-variable minimization
yz
wx 00
00 1
01
11
10
yz
wx 00
00 1
01
11
10
01
01
11
11
10
10
f = w . x. y w. x. z w . y. z
f = w . x. y w. x. z x . y. z
84
Groups of 4
yz
wx 00
00 0
y.z
01
11
10
01
11
10
01
11
10
yz
wx 00
00 0
01
11
10
w. x
x. z
w. z
85
yz
wx 00
00 0
01
11
10
yz
wx 00
00 0
01
01
11
10
11
01
11
10
01
11
10
10
yz
wx 00
00 1
x. z
01
11
10
yz
wx 00
00 1
01
11
10
01
11
10
x. z
x. z
??
86
Groups of 8
yz
wx 00
00 0
01
11
10
01
11
10
01
11
10
01
11
10
01
11
10
yz
wx 00
00 1
yz
wx 00
00 0
01
11
10
01
11
10
yz
wx 00
00 1
01
11
10
87
Examples
yz
wx 00
00 0
01
11
10
yz
wx 00
00 0
01
11
10
01
01
11
11
10
10
88
a
Decimal
Decoder
b
c
d
Y3
y9
a b c
d y0y1y2y3y4y5y6y7y8y9
0 0 0 0 1000000000
0 0 0 1 0100000000
0 0 1 0 0010000000
0 0 1 1 0001000000
0 1 0 0 0000100000
cd
ab 00
00 0
0 1 0 1 0000010000
01
11
10
0 1 1 0 0000001000
0 1 1 1 0000000100
1 0 0 0 0000000010
01
11
1 0 1 0
xxxxxxxxxx
1 0 1 1
10
1 1 0 0
xxxxxxxxxx
xxxxxxxxxx
1 1 0 1
xxxxxxxxxx
1 1 1 0
xxxxxxxxxx
1 1 1 1
xxxxxxxxxx
y3 a.b.c.d
1 0 0 1 0000000001
89
Y3
cd
ab 00
00 0
01
11
10
01
11
10
y3 b.c.d
Dont care terms should only be included in encirclements if it helps in
obtaining a larger grouping or smaller number of groups.
Electronics - I, The LNM Institute of
Information Technology, Jaipur
90
y
x
0
y
x
0
f = x y
f = x x. y x. y
x ( x x). y
x y
y
x
0
f=y
91
y
x
0
y
x
0
f =x
f=y
x
x. z
yz
00
01
11
10
f =( x . z ).( x z )
Electronics - I, The LNM Institute of
Information Technology, Jaipur
xz
f = x . z x. z
92
x yz
yz
wx 00
00 0
01
11
10
01
11
10
x yz
w y z
w x
93
Example
Obtain the minimized PoS by suitably using dont care terms
yz
wx 00
00 1
01
11
10
01
11
10
f =( x w z ).( x w y ).( y z )
Electronics - I, The LNM Institute of
Information Technology, Jaipur
94
Design Flow
System Description
system
x
0
0
0
0
1
1
1
1
Truth Table
y z
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
f
0
1
0
1
0
1
0
1
Boolean Expression
f = x.y . z x. y . z x. y . z x. y . z
Minimized
Boolean Expression
f = x . z x. z
x
y
y
Gate Netlist
z
x
z
95
x3
x1
x2
x3
x1
x2
x3
x1
x2
x3
Cost
Inverter
AND-OR-Invert
Y AB C
3
96
IMPLEMENTATION USING
SPECIFIC GATES
Electronics - I, The LNM Institute of
Information Technology, Jaipur
97
x. y
x. x x
x. y
f = x. y x y
h
Electronics - I, The LNM Institute of
Information Technology, Jaipur
98
c
f
a
b
c
d
g
h
99
f A .B B.B A. B A. A
B ( A B ) A( A B )
100
xx x
x y
x y
f = x y x. y
101
c
f
a
b
c
f
d
g
h
102
yz
00
01
11
10
0
x
z
x
z
f =( x . z ).( x z )
103
COMBINATIONAL CIRCUIT
DESIGN
Electronics - I, The LNM Institute of
Information Technology, Jaipur
104
Digital Circuits
Combinational Circuits
Sequential Circuits
X
CC
X
CC
W
Storage
elements
105
S(0:7)
8-bit adder
B(0:7)
A7A6...A0
B7B6...B0 S7S6...S0 C
00...0
00...0
00...0
00...1
00...0
00...1
00...0
00...1
00...1
System
Description
Truth
Table
Boolean
expression
Minimized Boolean
expression
Gate
Netlist
106
1101
S(0:7)
+ 1110
8-bit adder
B(0:7)
11011
a b c S CY
C7
S7
C1
S1
C0
S0
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1-bit adder
1-bit adder
1-bit adder
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
B7
A7
B1
A1
B0
A0
1 1 1 1 1
107
General Approach
Sub-system-1
Sub-system-2
System
Sub-system-3
There are certain sub-systems or blocks that are used quite often such as :
1.
2.
3.
4.
5.
6.
decoders, encoders
Multiplexers
Adder/Subtractors, Multipliers
Comparators
Parity Generators
..
Electronics - I, The LNM Institute of
Information Technology, Jaipur
108
Decoders
Maps a smaller number of inputs to a larger set of outputs in general
B
A
B
2-to-4 line
decoder
y0
0 0 1
0 0 0
y1
0 1 0
1 0 0
1 0 0
0 1 0
1 1 0
0 0 1
y2
y3
y0
A
B
2-to-4 line
decoder
A Y0 Y1 Y2 Y3
y1
y2
y3
a Y0 Y1 Y2 Y3
0 0 0
1 1 1
0 1 1
0 1 1
1 0 1
1 0 1
1 1 1
1 1 0
Electronics
- I, The LNM Institute of
Active
Low
Information Technology, Jaipur
109
Example
M-1
M-1
M-2
2-to-4
decoder
M-2
M-3
M-3
M-4
M-4
110
2/4
y0
y1
y2
A
B
y3
2/4
y0
y1
y2
A
B
y3
E B
A Y0 Y1 Y2 Y3
x 0
0 0 0
1 0 0 1
0 0 0
1 0 1 0
1 0 0
1 1 0 0
0 1 0
1 1 1 0
0 0 1
E B
A Y0 Y1 Y2 Y3
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
111
2/4
y0
y1
y2
A
B
y3
E B
A Y0 Y1 Y2 Y3
x 0
0 0 0
1 0 0 1
0 0 0
1 0 1 0
1 0 0
1 1 0 0
0 1 0
1 1 1 0
0 0 1
Y0
A
E.B.A
Y1
E.B.A
Y2
B
E.B.A
Y3
112
y min term
0
0
1
1
0
1
0
1
x.y
x.y
x.y
x.y
Y0
E .B.A
m0
m1
m2
m3
Y1
E .B.A
Y2
E.B.A
Y3
B A f1
0
0
1
1
0
1
0
1
0
1
1
0
2/4
1
1
0
y0
y1
y2
A
B
y3
0
1
0
0
113
C B A
0
0
0
0
1
1
1
1
1
0
1
0
1
0
0
0
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
3/8
0
0
0
0
A
B
C
y0
y1
y2
y3
y4
y5
y6
y7
0
1
1
1
1
1
1
1
114
3/8
E
A
B
C
y0
y1
y2
y3
y4
y5
y6
y7
2/4
C
0
2/4
y0
y1
y2
A
B
E
y3
2/4
y4
y5
y6
A
B
y7
115
E C B A y0
y1 y2 y3 y4 y5 y6 y7
0 x x x
0 0 0 0
0 0 0
1 0 0 0
1 0 0 0
0 0 0
1 0 0 1
0 1 0 0
0 0 0
1 0 1 0
0 0 1 0
0 0 0
1 0 1 1
0 0 0 1
0 0 0
1 1 0 0
0 0 0 0
0 0 0
1 1 0 1
0 0 0 0
1 0 0
1 1 1 0
0 0 0 0
0 1 0
1 1 1 1
0 0 0 0
0 0 1
1
0
A
B
2/4
E
0
C
0
2/4
y0 0
y1 1
y2 0
y3 0
2/4
y4 0
0
y5
y 0
6
E B
A Y0 Y1 Y2 Y3
x 0
0 0 0
1 0 0 1
0 0 0
1 0 1 0
1 0 0
1 1 0 0
0 1 0
1 1 1 0
0 0 1
A
B
y7 0
116
a
f
b
c
d
e
f
g
b
g
d
a
b
g
c
d
5
5
5
5
5
D
C
B
7-segment
decoder
(abcdefg)
5
0
Electronics - I, The LNM Institute of
Information Technology, Jaipur
117
D
b
C
B
7-segment
decoder
(abcdefg)
BA
DC 00
00 1
01
11
10
01
11
10
118
D
C
B
7-segment
decoder
(abcdefg)
A
BL
119
Encoders
An encoder performs the inverse operation of a decoder.
d3
4/2
0
1
2
3
d 1d 0
d3d2 00
00
01
01
0
11
10
1
11
10
d2 d1 d0 B A
0 0
1 0 0
0 1
0 0 1
1 0
0 1 0
0 0
0 1 1
d 1d 0
d3d2 00
00
01
01
0
11
10
0
B d1 d 0
11
1
A d2 d0
10
120
M-1
M-1
M-2
M-2
2-to-4
decoder
M-3
M-3
M-4
M-4
M-1
4/2
encoder
2/4
decoder
M-2
M-3
M-4
Electronics - I, The LNM Institute of
Information Technology, Jaipur
121
Priority Encoders
D0
printer
D1
D2
Resource
4:1 MUX
X, Y have to be determined
based on this priority order and
the requests to use the resource.
D3
x
R0
R1
R2
R3
y
priority
Encoder
R1R0
R3R2 00
00 0
R 1R 0
R3R2 00
R0
R1 R2 R3 x
0 0
0 0
0 0 0
01
01
1 0
0 0 1
11
11
0 1 0
10
10
1 1 1
01
11
10
x R2 R3
00
Y
01
11
10
y R1 R2 R3
122
Gray Codes
decimal
Natural
Binary
Gray
0000
0000
0001
0001
0010
0011
0011
0010
0100
0110
0101
0111
0110
0101
0111
0100
1000
1100
1001
1101
10
1010
1111
11
1011
1110
12
1100
1010
13
1101
1011
14
1110
1001
15
1111
1000
0111-0000-1000
123
124
Parity
Extra bits are added to aid in error detection and correction
decimal
Binary
Even
parity
Odd
parity
000
0000
0001
001
0011
0010
010
0101
0100
011
0110
0111
100
1001
1000
101
1010
1011
110
1100
1101
111
1111
1110
125
Multiplexers
I0
2:1
mux
I1
I0
I1
I0
I0
1
I1
I0
0
Y0
0
0
Electronics - I, The LNM Institute of
Information Technology, Jaipur
126
I0
00
I1
I2
01 4:1
10 mux
I3
11
S 1 S0
0 0
I0
0 1
I1
1 0
I2
1 1
I3
S1 S 0
S0
S1
I0
I1
I2
I3
Electronics - I, The LNM Institute of
Information Technology, Jaipur
127
S1
1
c
S2
0 0 a+c
0 1 a+d
1 0 b+c
1 1 b+d
8-bit ader
= a+c
128
y x1 x2 x1 x2
x2
x2
0
y
1
x1
x1 x2
y = x2 when x1 = 0
y = x2 when x1 = 1
129
F ( x, y, z ) (1, 2, 6, 7)
A 3 variable function can be implemented with a 4:1 mux with 2 select lines
x
0
00
x
1
01
10
11
y
z F
0 0
1
0
0 0
0 1
0
1
1
0
0 1
1 0
0
1
1 0
1 1 0
1 1 1
F = 0 when yz = 00
F = x when yz =01
F = 1 when yz = 10
F = x when yz = 11
130
Mux. expansion
E
I0
I1
E S
y
S1
1 0
I0
1 1
I1
I0
I1
I1
S0 1
S 1 S0
0 0
I0
0 1
I1
1 0
I2
1 1
I3
I2
I3
I1
0
S0
131
Mux. expansion
E
I0
I1
E S
y
S1
I1
1 0
I0
1 1
I1
I0
S0
S1 S0
0 0
I0
0 1
I1
1 0
I2
1 1
I3
I2
I3
I3
I3
1
S0
132
DeMultiplexer
u-1
u-11
u-1
u-2
u-22
u-2
u-11
u-22
Demux
Mux
u-3
u-33
u-3
u-4
u-44
u-4
Data x
S1
S0
0
1
2
3
u-33
u-44
S1 S0 y0 y1 y2 y3
0 0
0 1
0 0 0
0 x 0 0
1 0
0 0
0
x
1
1
0
0
0
Electronics - I, The LNM Institute of
Information Technology, Jaipur
133
Data
S0
A
B
Dmux
S1 S0 y0 y1 y2 y3
0 0
0 1
0 0 0
0 x 0 0
1 0
0 0
1 1
0
0 0 0 x
y3
E B
A Y0 Y1 Y2 Y3
x 0
0 0 0
1 0 0 1
0 0 0
1 0 1 0
1 0 0
1 1 0 0
0 1 0
1 1 1 0
0 0 1
Data
Y0
S0
0
S1
y0
y1
y2
0
1
2
3
S1
2/4
Data
Y1
Y1
Y2
Y0
Y2
B
Y3
Y3
134
Comparator
A(0:3)
B(0:3)
A<B
4-bit
comparator
A>B
0000
0000
0001
0001
0000
A=B
a
b
a<b
a
b
1-bit
comparator
a>b
a>b
a=b
a<b
a
b
a=b
a
b
135
a3<b3
a3
b3
1-bit
comparator
a3>b3
a3=b3
a2<b2
a2
b2
1-bit
comparator
a2>b2
a2=b2
a1<b1
a1
b1
A>B
1-bit
comparator
a1>b1
a1=b1
a0<b0
a0
b0
1-bit
comparator
A=B
a0>b0
a0=b0
136
Adder/Subtractor
S
Half Adder
a b
0 0
0 0
0 1
1 0
1 0
1 0
1 1
0 1
a b Cin S Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
111
110
0 1 1 0 1
Cout
Full Adder
Cin
1 0 0 1 0
1 0 1 0 1
1111
1 1 0 0 1
1 1 1 1 1
137
S Cin (a b)
ab
Cin (a b)
S
Cin .(a b)
a.b
Cout
Cin
138
4-bit Adder
S(0:3)
Cout
A 3A 2A 1A 0 B 3B 2B 1B 0 S 3S 2S 1S 0
4-bit adder
C 3 C 2 C1
Cout
0000
0000
0000
0000
0001
0001
0001
0000
0001
A 3 A 2 A 1A 0
B 3 B 2 B 1B 0
C 4 S 3 S 2 S 1S 0
A(0:3)
B(0:3)
S3
C4
C2
C3
FA
FA
A3
B3
S0
S1
S2
A2
C1
FA
B2
A1
B1
0
FA
A0
B0
139
Subtraction
A - B = A + 2s complement of B
A - B = A + 1s complement of B+1
A - B = A + B+1
FA
FA
FA
B3
A3
FA
B2
A2
B1
A1
B0
A0
1
B3
B2
B1
B0
One needs add a circuit for predicting errors resulting from overflow
Electronics - I, The LNM Institute of
Information Technology, Jaipur
140
Adder/Subtractor
FA
A3
FA
B3
A2
FA
B2
A1
FA
B1
A0
FA
B0
A3
FA
FA
A2
FA
A1
A0
1
B3
FA
A3
FA
B2
FA
A2
B1
B0
FA
A1
A0
M=1
B3
B2
B1
B0
141
Multiplier
B1
B0
A1
A0
A0B1
C3
A1B1
A1B0
C2
C1
multiplicand
multiplier
A0B0
Partial products
C0
A0
A1
B0
B1
HA
C3
B1
B0
HA
C2
C1
C0
142
SEQUENTIAL CIRCUITS
Electronics - I, The LNM Institute of
Information Technology, Jaipur
143
Digital Circuits
Combinational Circuits
Sequential Circuits
X
CC
X
CC
Storage
elements
144
NOR SR Latch
S
1
Q 1; Q 0 Set State
Q 0; Q 1 Re set State
Q
0
State
SET
145
NOR SR Latch
Reset
R
Q 1; Q 0 Set State
Q 0; Q 1 Re set State
Set
S
SET
RESET
State
146
HOLD State
R
S
1
SET
RESET
Q
0
State
HOLD
INVALID
147
A more serious problem occurs when we switch the latch to the hold state by
changing RS from 11 00 .
Suppose the inputs do not change
simultaneously and we get the situation 11 01* 00
Q=1
148
R 1
R 0
0
Q
Q
S
1
Q
0
Q
Q=1
Suppose the inputs change as RS = 11 10* 00
R
0
Q
Q=0
So although output is well defined when we apply RS = 11, it becomes
unpredictable once we switch the latch to hold state by applying RS = 00. That
is why RS = 11 is not used as an input combination.
Electronics - I, The LNM Institute of
Information Technology, Jaipur
149
1
1
0
1
Q
S
0
0
Q=1
1
1
0
1
0
1
Q
S
Q=0
150
NAND Latch
S
S
0
SET
RESET
Q
1
State
HOLD
INVALID
151
EN
Hold State
0
1
Q
EN
1
R
Enable
S R
Q Q
x x
Q Q
Hold
1 0
1 0
Set
0 1
0 1
Reset
0 0
Q Q
Hold
1 1
0 0
Invalid
State
152
D latch
1
1
EN
R
S R
Q Q
x x
Q Q
Hold
1 0
1 0
Set
0 1
0 1
Reset
0 0
Q Q
Hold
1 1
0 0
Invalid
EN
0
Enable
S
R
State
EN
153
CC
Storage
elements
n
Clock
Data (x)
X(n)
154
Example
an
bn 0
cn
0
0
zn
0
yn
clk
Clock
an
bn
cn
y
z
155
Example
an
bn 1
cn
1
0 1
1 0
zn 0
0 1
yn
clk
Clock
an
bn
cn
y
z
156
zn
1
D
clk
yn
clk
y
z
157
clk
Clock
158
clk
Clock
159
Master-Slave D Flip-flop
D
slave
master
EN
EN
clk
Clock
Master
Slave
clk
160
10
5
0 1
Q
0 1
clk
1
3
1
D
Q
1 0
161
1
5
1
clk
1
3
1 0
D
0 1
162
1
S
clk
3
clk
R
0
Reset
Electronics - I, The LNM Institute of
Information Technology, Jaipur
163
Characteristic table
Given a input and the present state of the flip-flop,
what is the next state of the flip-flop
D
Inputs (D)
clk
Q(t+1)
Q(t 1) D
JK Flip-flop
J
Inputs J
KQ(t+1)
0 Q(t)
1 Q(t)
clk
K
Characteristic equation
164
Toggle or T Flip-flop
Inputs (T)
clk
Q(t+1)
Q(t)
Q(t)
Q(t+1)
165
Excitation Table
clk
K
Q(t+1)
Q(t)
Q(t)
Inputs
Q(t+1)
Q(t)
Inputs
D
clk
Q
D
Q(t+1)
Q(t+1)
Q(t)
166
Convert a D FF to JK FF
CC
clk
JK
Q 00
01
11
10
Q(t+1)
Q(t)
Q(t)
Q(t)
Q(t)
D
J
clk
Q
D Q.J Q.K
Electronics - I, The LNM Institute of
Information Technology, Jaipur
167