Solution of Homework5
Solution of Homework5
1 Find the minimum-cost SOP and POS forms for the function f (x1, x2, x3) = ∑m(1, 2, 3, 5).
Solution:
f (x1, x2 , x3 ) = ∑m(1,2,3,5)
x1x2
x3 00 01 11 10
0
0 1 0 0
0 2 6 4
1
1 1 0 1
1 3 7 5
f ( x1, x2 , x3 ) = x1x2 + x2 x3
Mapping the 1’s from the K-map as follows
f ( x1 , x2 , x3 ) = x1 x2 + x2 x3 - This is the minimum-cost SOP form.
f (x1, x2 , x3 ) = ∑m(1,2,3,5)
x1x2
x3 00 01 11 10
0
0 1 0 0
0 2 6 4
1
1 1 0 1
1 3 7 5
f (x1, x2 , x3 ) = ( x1 + x2 )(x2 + x3 )
Mapping the 0’s from the K-map as follows
f ( x1 , x2 , x3 ) = ( x1 + x2 )( x2 + x3 ) - This is the minimum-cost POS form.
4.2 Repeat problem 4.1 for the function f (x1, x2, x3) = ∑m(1, 4, 7) + D(2, 5).
Solution:
f ( x1, x2 , x3 ) = ∑m(1,4,7) + D(2,5)
x1x2
x3 00 01 11 10
0
0 d 0 1
0 2 6 4
1
1 0 1 d
1 3 7 5
f ( x1, x2 , x3 ) = x2 x3 + x1x3 + x1 x2
Mapping the 1’s from the K-map as follows
f ( x1 , x 2 , x3 ) = x 2 x3 + x1 x3 + x1 x 2 -This is the minimum-cost SOP form.
0
0 d 0 1
0 2 6 4
1
1 0 1 d
1 3 7 5
4.5 Repeat problem 4.1 for the function f (x1, . . . , x5) = ∏M(1, 4, 6, 7, 9, 12,15, 17, 20, 21,
22, 23, 28, 31).
Solution:
f ( x1, x2 , x3 , x4 , x5 ) = ∏ M (1, 4, 6, 7, 9, 12,15,17, 20, 21,22,23, 28, 31)
x1x2 . x1x2
00 01 11 10 00 01 11 10
x3x4 x3x4
00 1 1 1 1 00 0 0 1 0
0 8 24 16 1 9 25 17
01 1 1 1 1 01 1 1 1 1
2 10 26 18 3 11 27 19
11 0 1 1 0 11 0 0 0 0 x1x2 x4 x5
6 14 30 22 7 15 31 23
10 0 0 0 0 10 1 1 1 0
4 12 28 20 5 13 29 21
x5 = 0 x5 = 1
x2 x4 x5 x3 x4
x5 .x3 x1x3 x4 x5
or
f ( x1 , x2 , x3 , x4 , x5 ) = ∏ M (1, 4, 6, 7, 9,12,15,17, 20, 21,22,23, 28, 31)
.
x2x3 00 01 11 10 x2x3 00 01 11 10
x4x5 x4x5
00 1 0 0 1 00 1 0 0 1
0 4 12 8 16 20 28 24
01 0 1 1 0 01 0 0 1 1
1 5 13 9 17 21 29 25
11 1 0 0 1 11 1 0 0 1
3 7 15 11 19 23 31 27
10 1 0 1 1 10 1 0 1 1
2 6 14 10 18 22 30 26
x1 = 0 x1 = 1
x2 x4 x5
x5 .x3 x1 x2 x4 x5
x1 x3 x4 x5
x3 x4
01 1 1 1 1 01 1 1 1 1
2 10 26 18 3 11 27 19
11 0 1 1 0 11 0 0 0 0
6 14 30 22 7 15 31 23
10 0 0 0 0 10 1 1 1 0
4 12 28 20 5 13 29 21
x5 = 0 x5 = 1
(x + x + x + x )
(x + x + x )
3 4 5 (x + x + x )
2 3 4
(x + x + x )
1 3 4 5
3 4 5
(x + x + x + x )
1 2 4 5
or
(x + x + x )
3 4 5
x2x3 00 01 11 10 x2x3 00 01 11 10
x4x5 x4x5
00 1 0 0 1 00 1 0 0 1
0 4 12 8 16 20 28 24
01 0 1 1 0 01 0 0 1 1
1 5 13 9 17 21 29 25
11 1 0 0 1 11 1 0 0 1
3 7 15 11 19 23 31 27
10 1 0 1 1 10 1 0 1 1
2 6 14 10 18 22 30 26
x1 = 0 x1 = 1
(x + x + x ) 3 4 5
(x + x + x ) 2 3 4
(x + x + x + x )
1 3 4 5 (x + x + x + x ) 1 2 4 5
4.12 A circuit with two outputs has to implement the following functions
f (x1, . . . , x4) =∑m(0, 2, 4, 6, 7, 9) + D(10, 11)
g(x1, . . . , x4) =∑m(2, 4, 9, 10, 15) + D(0, 13, 14)
Design the minimum-cost circuit and compare its cost with combined costs of two circuits
that implement f and g separately. Assume that the input variables are available in both
uncomplemented and complemented forms.
Solution:
The Karnaugh Map for getting the minimum cost SOP form for the function f is:
f (x1, x2 , x3 , x4 ) = ∑m(0,2,4,6,7,9) + D(10,11)
x1x2 00 01 11 10
x3x4
00
1 1 0 0
0 4 12 8
01 0 0 0 1 x1 x2 x4
1 5 13 9
x1.x4 11 0 1 0 d
3 7 15 11
10 1 1 0 d
2 6 14 10
00
d 1 0 0
0 4 12 8
01 0 0 d 1
1 5 13 9
11 0 0 1 0 x1 x2 x3
3 7 15 11
10 1 0 d 1
2 6 14 10
00 00
1 1 0 0 d 1 0 0
0 4 12 8 0 4 12 8
01 0 0 0 1 01 0 0 d 1
1 5 13 9 1 5 13 9
11 0 1 0 d 11 0 0 1 0
3 7 15 11 3 7 15 11
10 1 1 0 d 10 1 0 d 1
2 6 14 10 2 6 14 10
Hence the first three terms are shared between the two functions.
The implementation of both the functions require:
Four 3-input AND gate
One 4-input AND gate
Two 4-input OR gate
Now the combine cost of the system is
The cost of system=total no. of gates+ total no of
inputs=(4+1+2)+{(3)(4)+(4)(1)+(4)(2)}=31
4.14 Implement the logic circuit in Figure 4.23 using NAND gates only.
Solution: the followings are the logic functions for g and f:
g ( x1 , x2 ) = x1.x2 + x1 x2
f ( x3 , x4 , g ) = x3 g + g x4
Now implementing the logic using only NAND gate can be done by considering the
following relationships
A = ( A. A) = (A ↑ A)
A + B = A.B = (A ↑ A) ↑ (B ↑ B )
AB = AB = (A ↑ B ) ↑ (A ↑ B )
Implementation of given logic function using only NAND gate is:
( )( )
g ( x1 , x2 ) = x1.x2 + x1 x2 = x1.x2 + x1 x2 = x1.x2 x1 x2
x1.x2 = x1.x2 .x2 = x1 ↑ (x2 ↑ x2 )
x1 x2 = x1.x1.x2 = (x1 ↑ x1 ) ↑ x2
[ ] [
g = (x1 ↑ (x2 ↑ x2 )) ↑ (x1 ↑ x1 ) ↑ x2 ]
( ) ( )
f ( x3 , x4 , g ) = x3 g + g x4 = x3 g + g x4 = ( x3 g ). g x4
(x3 g ) = x3 ↑ g
(g x ) = g ↑ x = (g ↑ g ) ↑ x
4 4 4
f = [x ↑ g ] ↑ [(g ↑ g ) ↑ x ]
3 4
x1
x2
g
x2
x1
g
x3
f
x4
g