Lecture Solved Problems On K-Map
Lecture Solved Problems On K-Map
Optimization methods:
Boolean Algebra
K-Map
Tabulation method
1
The Map Method
The complexity of the digital logic gates
The complexity of the algebraic expression
Logic minimization
Algebraic approaches
The Karnaugh map
A simple straight forward procedure
A pictorial form of a truth table
Applicable if the number of variables < 7
A two-variable map
Four minterms
x' = row 0; x = row 1
y' = column 0; y = column 1
3
A Three-variable Map
A three-variable map
Eight minterms
The Gray code sequence
Any two adjacent squares in the map differ by only on variable
Primed in one square and unprimed in the other
e.g., m5 and m7 can be simplified
m5+ m7 = xy'z + xyz = xz (y'+y) = xz
4
A Three-variable Map
m0 and m2 (m4 and m6) are adjacent
m0+ m2 = x'y'z' + x'yz' = x'z' (y'+y) = x'z'
m4+ m6 = xy'z' + xyz' = xz' (y'+y) = xz'
5
Example 3.1
Simplify the Boolean function F(x, y, z) = S(2, 3, 4, 5)
F(x, y, z) = S(2, 3, 4, 5) = x'y + xy'
6
Example 3.2
Simplify F(x, y, z) = S(3, 4, 6, 7)
F(x, y, z) = S(3, 4, 6, 7) = yz+ xz'
7
Four adjacent Squares
Consider four adjacent squares
2, 4, and 8 squares can be simplified
m0+m2+m4+m6 = x'y'z'+x'yz'+xy'z'+xyz' = x'z'(y'+y) +xz'(y'+y) =
x'z' + xz‘ = z'
m1+m3+m5+m7 = x'y'z+x'yz+xy'z+xyz =x'z(y'+y) + xz(y'+y) =x'z
+ xz = z
8
Example 3.3
Simplify F(x, y, z) = S(0, 2, 4, 5, 6)
F(x, y, z) = S(0, 2, 4, 5, 6) = z'+ xy'
9
Example 3.4
let F = A'C + A'B + AB'C + BC
a) Express it in sum of minterms.
b) Find the minimal sum of products expression.
Ans:
F(A, B, C) =S(1, 2, 3, 5, 7) = C + A'B
10
Four-Variable Map
The map
16 minterms
Combinations of 2, 4, 8, and 16 adjacent squares
11
Example 3.5
Simplify F(w, x, y, z) = S(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
F = y'+w'z'+xz'
12
Example 3.6
Simplify F = ABC + BCD + ABCD + ABC
13
Prime Implicants
Prime Implicants
All the minterms are covered.
Minimize the number of terms.
A prime implicant: a product term obtained by
combining the maximum possible number of
adjacent squares (combining all possible maximum
numbers of squares).
Essential P.I.: a minterm is covered by only one
prime implicant.
The essential P.I. must be included.
14
Prime Implicants
Consider F(A, B, C, D) = Σ(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)
The simplified expression may not be unique
F = BD+B'D'+CD+AD = BD+B'D'+CD+AB'
= BD+B'D'+B'C+AD = BD+B'D'+B'C+AB'
15
Five-Variable Map
16
Example 3.7
Simplify F = S(0, 2, 4, 6, 9, 13, 21, 23, 25, 29, 31)
F = A'B'E'+BD'E+ACE
17
Example 3.7 (cont.)
Another Map for Example 3-7
18
Example 3.8
20
Sum-of-Minterm Procedure
Consider the function defined in Table 3.2.
In sum-of-minterm:
F ( x, y, z) = (1,3,4,6)
21
Sum-of-Minterm Procedure
Consider the function defined in Table 3.2.
Combine the 1’s:
F ( x, y, z ) = xz xz
22
Don't-Care Conditions
The value of a function is not specified for certain
combinations of variables
BCD; 1010-1111: don't care
23
Example 3.9 (cont.)
F = yz + w'x'; F = yz + w'z
F = S(0, 1, 2, 3, 7, 11, 15) ; F = S(1, 3, 5, 7, 11, 15)
Either expression is acceptable
24
3.3 Simplify the following Boolean expression using three-
variable maps: d) F(x, y, z) = x y z + x\ y\ z + x y\ z\
y
yz
xyz x 00 01 11 10
x y\ z \ 0 1
x 1 1 1
x\ y\ z
25
3.5 Simplify the following Boolean expression using four-
variable maps: a) F(w,x, y, z) = S(1,4,5,6,12,14,15)
y
yz
wx 00 01 11 10
x z\ 00 1
w\ y\ z
wxy
01 1 1 1
x
11 1 1 1
w
10
F =w\ y\ z+w x y+ x z\ z
26
3.5 Simplify the following Boolean expression using four-
variable maps: b) F(A,B,C,D)= S(1,5,9,10,11,14,15)
C
CD
AB 00 01 11 10
AC
00 1
A\ C\ D
01 1
A B\ D B
B\ C\ D
11 1 1
A
10 1 1 1
D
F =A\C\D+AC+(AB\D or B\C\D)
27
3.5 Simplify the following Boolean expression using four-
variable maps: c) F(w,x, y, z) = S(0,1,4,5,6,7,8,9)
y
yz
wx 00 01 11 10
w\ x 00 1 1
x\ y\ 01 1 1 1 1
x
11
w
F =x\y\+w\x 10 1 1
28
3.5 Simplify the following Boolean expression using four-
variable maps: d) F(A,B,C,D)= S(0,2,4,5,6,7,8,10,13,15)
C
CD
AB 00 01 11 10
B\ D\ 00 1 1
BD
01 1 1 1 1
A\ B B
11 1 1
A\ D\ A
10 1 1
D
F =B\D\+BD+(A\B or A\D\)
29
3.6 Simplify the following Boolean expression using four-
variable maps: a)A\B\C\D\+AC\D\+B\CD\+A\BCD+BC\D
C
CD
AB 00 01 11 10
B\ D\ 00 1 1
A\ B D 01 1 1
A B C\ B
11 1 1
A
10 1 1
D
F =B\D\+A\BD+ABC\
30
3.6 Simplify the following Boolean expression using four-
variable maps: b) x\z+w\xy\+w(x\y+xy\)
= x\z+w\xy\+wx\y+wxy\
y
yz
wx 00 01 11 10
x\ z 00 1 1
x y\ 01 1 1
w x\ y x
11 1 1
w
10 1 1 1
F =x\ z+xy\+wx\y
z
31
3.6 Simplify the following Boolean expression using four-
variable maps: c)A\B\C\D\+A\CD\+AB\D\+ABCD+A\BD
C
CD
AB 00 01 11 10
B\ D\
00 1 1
A\ BD
BCD 01 1 1 1
B
A\ B C 11 1
A
A\ C D\
10 1 1
D
F =B\D\+A\BD+BCD+(A\BC or A\CD\)
32
3.6 Simplify the following Boolean expression using four-
variable maps: d)A\B\C\D\+AB\C+B\CD\+ABCD\+BC\D
C
CD
AB 00 01 11 10
A\ B\ D\ 00 1 1
B C\ D
01 1
A C D\ B
11 1 1
A B\ C A
10 1 1
D
F =A\B\D\+BC\D+ACD\+AB\C
33
3.10 Simplify the following Boolean function by first finding the
essential prime implicants: c) F(A,B,C,D)=S(1,3,4,5,10,11,12,13,14,15)
C
CD
B C\ essential AB 00 01 11 10
A C essential 00 1 1
A\ B\ D non-essential 01 1 1
B
A B non-essential
11 1 1 1 1
A\ C\ D non-essential A
10 1 1
B\ C D non-essential
Redundant D
F =BC\+AC+A\B\D
34
3.15 Simplify the following Boolean function, together with don't care
condition d, and then express the simplified function in sum-of-
minterms form: b) F(A,B,C,D)=Sm(0,6,8,13,14) + Sd(2,4,10)
C
CD
AB 00 01 11 10
B\ D\
00 1 x
C D\
01 X 1
A B C\ D
B
11 1 1
A
F = B\D\+ABC\D+CD\ 10 1 x
F = S(0,2,6,8,10,13,14)
D
35
3.15 Simplify the following Boolean function, together with don't care
condition d, and then express the simplified function in sum-of-
minterms form: c) F(A,B,C,D)=Sm(4,5,7,12,13,14) +Sd(1,9,11,15)
C
CD
AB 00 01 11 10
B C\
00 x
BD
AB 01 1 1 1
B
11 1 1 x 1
A
F = BC\+BD+AB 10 x x
F = S(4,5,7,12,13,14,15)
D
36
Logic Diagram of a
Quadruple NAND Chip
37
NAND and NOR Implementation
NAND gate is a universal gate
Can implement any digital system
38
NAND Gate
39
Example 3.10
Example 3-10: implement F(x, y, z) =
F ( x, y, z) = (1,2,3,4,5,7) F ( x, y, z ) = xy xy z
40
Procedure with Two Levels NAND
The procedure
Simplified in the form of sum of products;
A NAND gate for each product term; the inputs to
each NAND gate are the literals of the term (the
first level);
A single NAND gate for the second sum term (the
second level);
A term with a single literal requires an inverter in
the first level.
41
Multilevel NAND Circuits
Boolean function implementation
AND-OR logic → NAND-NAND logic
AND → AND + inverter
OR: inverter + OR = NAND
F = A(CD + B) + BC
42
NAND Implementation
43
NOR Implementation
NOR function is the dual of NAND function.
The NOR gate is also universal.
44
Graphic Symbols for a NOR Gate
F = (A + B)(C + D)E
45
Example
F = (AB +AB)(C + D)
46
AND-OR-Invert Implementation
49
Exclusive-OR Function
Exclusive-OR (XOR)
xy = xy'+x'y
Exclusive-NOR (XNOR)
(xy)' = xy + x'y'
Some identities
x0 = x
x1 = x'
xx = 0
xx' = 1
xy' = (xy)'
x'y = (xy)'
Commutative and associative
AB = BA
(AB) C = A (BC) = ABC
50
Exclusive-OR Implementations
Implementations
(x'+y')x + (x'+y')y = xy'+x'y = xy
51
Odd Function
ABC = (AB'+A'B)C' +(AB+A'B')C = AB'C'+A'BC'+ABC+A'B'C =
S(1, 2, 4, 7)
XOR is a odd function → an odd number of 1's, then F = 1.
XNOR is a even function → an even number of 1's, then F = 1.
52
XOR and XNOR
Logic diagram of odd and even functions
53
Four-variable Exclusive-OR function
Four-variable Exclusive-OR function
ABCD = (AB'+A'B)(CD'+C'D) =
(AB'+A'B)(CD+C'D')+(AB+A'B')(CD'+C'D)
54
Parity Generation and Checking
55
Parity Generation and Checking
56
Parity Generation and Checking
Parity Generation and Checking
A parity bit: P = xyz
Parity check: C = xyzP
C=1: one bit error or an odd number of data bit error
C=0: correct or an even # of data bit error
57