ICT 1105 - Digital Electronics Fundamentals: Karnaugh Maps and Minimization of Boolean Expressions
ICT 1105 - Digital Electronics Fundamentals: Karnaugh Maps and Minimization of Boolean Expressions
Fundamentals
Karnaugh Maps
and
Minimization of Boolean Expressions
Karnaugh Maps
Graphical representation of a truth table
Can be used to minimize logic functions
Uses Logic Adjacency
– A.B + A.B' = A (Boolean Algebra Law)
Does not produce unique results
Not directly transferable to computer algorithms
Why not just use Boolean Algebra?
Boolean algebra is useful for general proofs
Difficult to use for minimization
2
Three-variable K-Map
row #
xx1 xy2 xz3 Gray code
xx1xy
2
0 0 0 0 m0 x3
z 00 01 11 10
1 0 0 1 m1
0 m0 m2 m6 m4
2 0 1 0 m2 LSB
3 0 1 1 m3 1 m1 m3 m7 m5
4 1 0 0 m4 y z
5 1 0 1 m5 x (b) Karnaugh map
6 1 1 0 m6
7 1 1 1 m7
3
Four-variable K-Map
Gray code x1
x1 x2
x3 x4
00 01 11 10
00 m0 m4 m 12 m8
Gray code
01 m1 m5 m 13 m9
x4
11 m3 m7 m 15 m 11
x3
10 m2 m6 m 14 m 10
x2
4
Four-variable K-Map
5
Minimization using K-Maps
6
Minimization using K-maps
Enter minterms (for SOP) into K-map
Identify adjacent cells
– Minterms differ in only one bit
Use adjacency to minimize logic function
– Gray code used for enumeration
• Specifies the location of each minterm in K-map
– Horizontal and Vertical adjacency
• Both are logically adjacent
– K-map wraps
• Left and right columns are logically adjacent
• Top and bottom rows are logically adjacent
7
Minimization using K-Maps
Group adjacent cells to reduce
– the number of literals in a term
– the number of terms in a Boolean expression
Adjacencies are of size 1, 2, 4, 8, …
Number of adjacent cells is a power of 2
Adjacent cells form a rectangle
The larger the grouping of adjacent cells the
greater the minimization of the logical function.
8
Minimization using K-Maps
9
Two-variable K-Map
Example:
10
Two-variable K-Map
# A B F
0 0 0 1
1 0 1 1
2 1 0 0
3 1 1 1
11
Three-variable K-Map
Example:
12
Three-variable K-Map
# A B C F
0 0 0 0 0
1 0 0 1 1
2 0 1 0 0
3 0 1 1 0
4 1 0 0 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
13
Minimization using K-Maps
Exercise:
14
Minimization using K-Maps
# A B C F
0 0 0 0 1
1 0 0 1 0
2 0 1 0 1
3 0 1 1 0
4 1 0 0 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
15
Four-variable K-Map
Example:
16
Four-variable K-Map
# A B C D F
0 0 0 0 0 0
1 0 0 0 1 0
2 0 0 1 0 1
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 0
6 0 1 1 0 0
7 0 1 1 1 0
8 1 0 0 0 0
9 1 0 0 1 1
10 1 0 1 0 1
11 1 0 1 1 1
12 1 1 0 0 0
13 1 1 0 1 1
14 1 1 1 0 0
15 1 1 1 1 0
17
Four-variable K-Map
Example:
18
Four-variable K-Map
# A B C D F
0 0 0 0 0 0
1 0 0 0 1 0
2 0 0 1 0 1
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 0
6 0 1 1 0 1
7 0 1 1 1 1
8 1 0 0 0 0
9 1 0 0 1 1
10 1 0 1 0 1
11 1 0 1 1 1
12 1 1 0 0 0
13 1 1 0 1 1
14 1 1 1 0 1
15 1 1 1 1 1
19
Minimization using K-Maps
Exercise:
20
Minimization using K-Maps
# A B C D F
0 0 0 0 0 1
1 0 0 0 1 0
2 0 0 1 0 1
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 0
6 0 1 1 0 1
7 0 1 1 1 1
8 1 0 0 0 1
9 1 0 0 1 0
10 1 0 1 0 1
11 1 0 1 1 0
12 1 1 0 0 0
13 1 1 0 1 0
14 1 1 1 0 0
15 1 1 1 1 1
21
Minimization using K-Maps
22
Minimization using K-maps
Enter Maxterms (for POS) into K-map
Identify adjacent cells
– Maxterms differ in only one bit
Use adjacency to minimize logic function
– Gray code used for enumeration
• Specifies the location of each Maxterm in K-map
– Horizontal and Vertical adjacency
• Both are logically adjacent
– K-map wraps
• Left and right columns are logically adjacent
• Top and bottom rows are logically adjacent
23
Three-variable K-Map
Example:
24
Three-variable K-Map
# A B C F
0 0 0 0 0
1 0 0 1 1
2 0 1 0 0
3 0 1 1 0
4 1 0 0 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
25
Four-variable K-Map
Example:
26
Four-variable K-Map
# A B C D F
0 0 0 0 0 0
1 0 0 0 1 0
2 0 0 1 0 1
3 0 0 1 1 1
4 0 1 0 0 0
5 0 1 0 1 0
6 0 1 1 0 1
7 0 1 1 1 1
8 1 0 0 0 0
9 1 0 0 1 1
10 1 0 1 0 1
11 1 0 1 1 1
12 1 1 0 0 0
13 1 1 0 1 1
14 1 1 1 0 1
15 1 1 1 1 1
27