Lecture 4 K-maps
Lecture 4 K-maps
Lec. # 4
Karnaugh Map
x x'
x x'
x.y
(XY) = (XY)’’
y
y' = ( X’ + Y’)’
Procedure:
x (x.y')'
y'
F3
x'
z (x'.z)'
Procedure:
x (x+y')'
y'
F6
x'
z (x'+z)'
F6 = ((x+y')'+(x'+z)')' = (x+y').(x'+z)
Procedure:
Example: F3 = x.y'+x'.z
G = F3’= (x.y’+x’.z)’
Then
G = F3’ = (x’+y) . (x+z’)
Note:
G = F3’ ----------- > POS ( NOR Implementation)
X’ (x’+y)'
G = F3’ F3
Y
X
Z’ (x+z’)'
Procedure:
X’ (X’.Y)'
Y F7’ F7
X’
Z’ (X.Z’)'
▪ The arrangement of 0's and 1's within the map helps you
to visualize the logic relationships between the variables
and leads directly to a simplified Boolean statement.
Karnaugh maps
▪ Karnaugh maps, or K-maps, are often used to simplify logic problems with 2,
3 or 4 variables.
n
Cell = 2 ,where n is a number of variables
2
For the case of 2 variables, we form a map consisting of 2 =4 cells
as shown in Figure
A
A A A
A A
0 1 0 1
B B
00 10
B 0
0 2
B 0 AB AB
01 11
B 1
1 3
B 1
A B AB
Minterm
Examples of K-Maps:
▪ Examples:
Cell numbers are written in the cells.
▪ 2-variable K-map
B B B
0 1
A
A 0 0 1
A 1 2 3
23
3-Variable K-Map:
▪ 3-variable K-map
B B
BC BC
00 01 11 10 A
00 01 11 10
A
0 0 1 3 2 A
0 A B C A B C A BC A BC
1 1
4 5 7 6 A AB C AB C ABC ABC
C C C
24
4-variable K-map
CD
AB
00 01 11 10
00 0 1 3 2
01 4 5 7 6
11 12 13 15 14
10 8 9 11 10
25
Karnaugh maps
27
Simplification Guidelines for K-maps
1. Draw a K-map
2. Combine maximum number of 1’s following rules:
1. Only adjacent squares can be combined
2. All 1’s must be covered
3. Covering rectangles must be of size 1,2,4,8, … 2n
3. Check if all covering are really needed
4. Read off the SOP expression
2 variable K-Maps (Adjacency)
V
B B
A 1 1
A 1 1
1
Example #1: 2 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map, write the simplified sum-of-products (SOP)
logic expression for the logic function F1.
Solution:
V
J K F1 K K
0 0 1 1 1
J
0 1 1
1 0 0 J J 0 0
1 1 0
F1 = J
3-variable K-maps
B
BC
A 00 01 11 10
0 m0 m1 m3 m2
1 m4 m5 m7 m6
A
C
Example 1
BC
01 11 10
A00
0 1 3 2
0
1 1
A 4 5 7 6
1
1 1
C
Example 1
BC
01 11 10
A00
F = A’C + AC’ 0 1 3 2
0
1 1
A 4 5 7 6
1
1 1
C
Example 2
B
01 11 10
A00
0 1 3 2
0
1 1 1
A 4 5 7 6
1
1 1
C
Example 2
B
01 11 10
A00
F = A’ B’ + C’ 0 1 3 2
0
1 1 1
A 4 5 7 6
1
1 1
C
3 variable K-Maps (Adjacency)
0 0
1 1
00 01 11 10
0
1
3 variable K-Maps (Adjacency)
00 01 11 10 00 01 11 10
0 0
1 1
00 01 11 10
0
1
Example
▪ Minimize the function
F(A,B,C,D)=∑m(1,3,5,6,7,8,9,11,14,15)
C
CD
AB 00 01 11 10
00 1 1
01
1 1 1
B
11
1 1
10
A
1 1 1
F = CD + A’D + BC + AB’C’
Example
▪F(A,B,C,D) = Sm(0,1,2,5,8,9,10)
CD C=1
AB
00 01 11 10
00 1 1 1
01 1
B=1
11
A=1
10 1 1 1
D=1
Example
▪F(A,B,C,D)
=Sm(0,1,2,5,8,9,10)
CD C=1
AB
00 01 11 10
▪Solution: 00 1 1 1
01 1
F = B’ D’ + B’ C’ + A’ C’ D B=1
11
A=1
10 1 1 1
D=1
Example (POS)
▪F(A,B,C,D) = Sm(0,1,2,5,8,9,10)
Write F in the simplified product of sums
(POS)
CD C=1
▪Two methods? AB
00 01 11 10
▪You already know one!
00 1 1 1
01 1
B=1
11
A=1
10 1 1 1
D=1
Example (POS)
▪F(A,B,C,D) = Sm(0,1,2,5,8,9,10)
Write F in the simplified product of
sums (POS)
F’ = AB + CD + BD’ 00 1 1 0 1
01 0 1 0 0
Therefore, B=1
11 0 0 0 0
A=1
10 1 1 0 1
F’’ = F = (A’+B’)(C’+D’)(B’+D) D=1
Truth Table to K-Map Mapping
Four Variable K-Map
W X Y Z FWXYZ
Minterm – 0 0 0 0 0 0
Minterm – 1 0 0 0 1 1 V
YZ YZ YZ YZ
Minterm – 2 0 0 1 0 1
Minterm – 3 0 0 1 1 0
Minterm – 4 0 1 0 0 1 WX 0 0 1 1 0 3 1 2
Minterm – 5 0 1 0 1 1
Minterm – 6 0 1 1 0 0 1 1 1 0
WX
4 5 7 6
Minterm – 7 0 1 1 1 1
Minterm – 8 1 0 0 0 0
WX 1 0 1 1
Minterm – 9 1 0 0 1 0 12 13 15 14
Minterm – 10 1 0 1 0 1
Minterm – 11 1 0 1 1 0 WX 0 8 0 9 0 11 1 10
Minterm – 12 1 1 0 0 1
Minterm – 13 1 1 0 1 0
Minterm – 14 1 1 1 0 1
Minterm – 15 1 1 1 1 1