0% found this document useful (0 votes)
85 views9 pages

Karnaugh Maps

Karnaugh maps are a visualization technique for simplifying logical expressions. They represent truth tables in a two-dimensional grid, allowing patterns to be identified more easily. Variables are arranged along rows and columns, with their values (0 or 1) defining regions on the map. Combinations of variable values are represented by individual squares, showing the corresponding output. Simplified logical expressions can be read directly from contiguous groups of squares with the same output value. The technique can handle up to four variables and is useful for deriving minimal sum-of-products and product-of-sums expressions.

Uploaded by

Ma Seenivasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views9 pages

Karnaugh Maps

Karnaugh maps are a visualization technique for simplifying logical expressions. They represent truth tables in a two-dimensional grid, allowing patterns to be identified more easily. Variables are arranged along rows and columns, with their values (0 or 1) defining regions on the map. Combinations of variable values are represented by individual squares, showing the corresponding output. Simplified logical expressions can be read directly from contiguous groups of squares with the same output value. The technique can handle up to four variables and is useful for deriving minimal sum-of-products and product-of-sums expressions.

Uploaded by

Ma Seenivasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

5. Karnaugh Maps 5.1.

Karnaugh Map Definitions


o Objectives o A Karnaugh map is a two-dimensional truth-table.
This section presents a technique for simplifying logical Unlike ordinary (i.e., one-dimensional) truth tables,
expressions. It will: however, certain logical network simplifications can
n Define Karnaugh and establish the correspondence between be easily recognized from a Karnaugh map.
Karnaugh maps and truth tables and logical expressions. A B Z Z A
Z A
0 1
0 0 0 B
n Show how to use Karnaugh maps to derive minimal sum- 0 1 1 0 1 0 0 1
of-products and product-of-sums expressions. 1 0 1
1 1 0 B 1 0 1 1 0
n Introduce the concept of "don't care" entries and show how Truth Table Type 1 Map Type 2 Map
to extend Karnaugh map techniques to include maps with Two-Variable Maps
don't care entries. AB C Z Z A
Z A
0 00 0 B,C 0 1
o Reading Assignment 0 01 1
0 10 1
0 1 00 0 1
n Chapter 4. Optimized Implementation of Logic Functions 0 11 0 1 0
C
01 1 0
1 00 1
u Sections 4.1-4.5 on Karnaugh maps. 1 01 0 0 1 11 0 1
1 10 0 B
1 0 10 1 0
n Hazards: Chapter 9, Section 6 (Static hazards only). 1 11 1
Truth Table Type 1 Map Type 2 Map
Three-Variable Maps
Elec 326 5.1 Karnaugh Maps Elec 326 5.2 Karnaugh Maps

o The interpretation of a type 1 map is that the rows or


columns labeled with a variable correspond to region
A B C D Z
of the map where that variable has value 1.
0 0 0 0 0 A A A A
0 0 0 1 0 Z A,B
0 0 1 0 0 Z A D D D D
C,D 00 01 11 10
0 0 1 1 1 C C C C
0 1 0 0 0 0 0 1 0 00 0 0 1 0
0 1 0 1 1 B B B B
0 1 1 0 1 0 1 1 1 01 0 1 1 1 A=1 B=1 C=1 D=1
D
0 1 1 1 1 1 1 1 1 11 1 1 1 1 region region region region
1 0 0 0 0 C
1 0 0 1 1 0 1 1 1 10 0 1 1 1
1
1
0
0
1
1
0
1
1
1 B
o Numbering of Karnaugh Map Squares.
1 1 0 0 1 Type 1 Map Type 2 Map Z A Z A,B
1 1 0 1 1
1 1 1 0 1 B,C 0 1 C,D 00 01 11 10
1 1 1 1 1 Z A
Four-Variable Maps 0 1 00 0 4 00 0 4 12 8
B
Truth Table 0 0 2 01 1 5 01 1 5 13 9
1 1 3 11 3 7 11 3 7 15 11
10 2 6 10 2 6 14 10

Elec 326 5.3 Karnaugh Maps Elec 326 5.4 Karnaugh Maps

1
5.2. Minimal Sum-Of-Products Expressions
o Exercise: Plot the following expression on a Karnaugh map.
o Ordering of Squares
Z = (A•B)⊕(C+D) n The important feature of the ordering of squares is that the
squares are numbered so that the binary representations for
the numbers of two adjacent squares differ in exactly one
position.
u This is due to the use of a Gray code (one in which adjacent
numbers differ in only one position) to label the edges of a type 2
map.
u The labels for the type 1 map must be chosen to guarantee this
property.
n Note that squares at opposite ends of the same row or
column also have this property (i.e., their associated
numbers differ in exactly one position).

Elec 326 5.5 Karnaugh Maps Elec 326 5.6 Karnaugh Maps

o Merging Adjacent Product Terms o For k-variable maps, this reduction technique can also
Z = m 5 + m13 be applied to groupings of 4,8,16,...,2k rectangles all
Z A = A'•B•C'•D + A•B•C'•D of whose binary numbers agree in (k-2),(k-3),(k-
0 0 0 0 = (A'+A)•B•C'•D 4),...,0 positions, respectively.
0 1 1 0 = 1•B•C'•D
D
0 0 0 0 = B•C'•D
C
0 0 0 0
A'
B B
C'
D B
Z C' Z
A D
B
C'
D
Z = m5 + m7 + m13 + m 15
n Example = A'•B•C'•D + A'•B•C•D + A•B•C'•D + A•B•C•D
A • B • C'
Z A = (A'•C'!+ A'•C + A•C' + A•C) • (B•D)
0 0 1 0 = (A'•(C' + C) + A•(C' + C)) • (B•D)
A' • C • D
0 0 1 0
D
= (A' + A) •!(B•D)
C
1 1 0 0 = B•D
0 0 0 0

Elec 326 5.7 Karnaugh Maps Elec 326 5.8 Karnaugh Maps

2
o Basic Karnaugh Map Groupings for Three-Variable o Basic Karnaugh Map Groupings for Four-Variable
Maps. Maps.

Z1 Z3 Z5
A A A

1 1
1 1 1
C C C
1
B B B
1 1

Z2 Z4 Z6
A A A
1 1
1 1 1
C C C
1 1 1
B B B
1 1

Elec 326 5.9 Karnaugh Maps Elec 326 5.10 Karnaugh Maps

o Rules for Grouping:


n The number of squares in a grouping is 2i for some i such
that 1 ≤ i ≤ k.
n There are exactly k-i variables that have constant value for
all squares in the grouping.

o Resulting Product Terms:


n If X is a variable that has value 0 in all of the squares in the
grouping, then the literal X' is in the product term.
n If X is a variable that has value 1 in all of the squares in the
grouping, then the literal X is in the product term.
n If X is a variable that has value 0 for some squares in the
grouping and value 1 for others, then neither X' nor X are
in the product term.

Elec 326 5.11 Karnaugh Maps Elec 326 5.12 Karnaugh Maps

3
o In order to minimize the resulting logical expression,
o Invalid Karnaugh Map Groupings. the groupings should be selected as follows:
n Identify those groupings that are maximal in the sense that
they are not contained in any other possible grouping. The
product terms obtained from such groupings are called
Z A loop 1
prime implicants.
Z A
0 1 0 0 loop 2 u A distinguished 1-cell is a cell that is covered by only one prime
1 0 0 1
0 1 1 0 implicant.
D 1 1 0 1
D
C
1 1 1 0
1 1 1 1 u An essential prime implicant is one that covers a distiquished 1-
C
0 1 1 0
0 1 1 1 cell.
B

Violates Rule 1
B
n Use the fewest possible number of maximal groupings
Violates Rule 2
needed to cover all of the squares marked with a 1.
o Examples: Z #2
A
1 0 1 1
#1
0 1 1 0
D
0 1 1 1
C
1 0 1 1
#4
#3
B

Elec 326 5.13 Karnaugh Maps Elec 326 5.14 Karnaugh Maps

o Exercise: Derive minimal sum-of-products logical


expressions from the following Karnaugh maps.
X Y
A A

1 1 1 0 1 1 1 0
B
a. Z = A•B•D+A•B'•C'+A'•B•C'+A'•C•D+A'•B'•D' 1 1 0 0 1 1 0 0
b. Z = B•D+A•B'•C'+A'•B•C'+A'•C•D+A'•B'•D' D D
c. Z = B•D+A•B'•C'+A'•C'•D'+A'•B'•C 0 0 1 0 0 0 1 0
C
0 0 1 1 0 0 1 1
C B

X=

Y=
a. W3 = C'D+AC'+BC+A'B'D'
b. W3 = BD+AB+B'C'+A'CD'

Elec 326 5.15 Karnaugh Maps Elec 326 5.16 Karnaugh Maps

4
5.3. Minimal Product-Of-Sums Expressions
o Rules for Grouping:
o Merging Adjacent Product Terms. n Same as for sum-of-products, except that zero's are
grouped instead of ones.
o Resulting Sum Terms:
n If variable X has value 0 for all squares in the group, then
the literal X is in the sum term.
n If variable X has value 1 for all squares in the group, then
the literal X' is in the sum term.
n If variable X has value 0 for some squares in the group and
M3•M7 = (A+B'+C')•(A'+B'+C') value 1 for the others, then that variable does not appear in
= (A•A')+(B'+C') the sum term.
= 0 + (B'+C') o Prime Implicate:
= B' + C'
n Maximal grouping of zeros.

Elec 326 5.17 Karnaugh Maps Elec 326 5.18 Karnaugh Maps

o Examples:
o Comparison of Sum-of-Products and Product-of-
Sums Expressions.
Z1 A Z1 A
1 0 1 0 1 0 1 0
0 0 0 0 0 0 0 0
D D
0 0 0 1 0 0 0 1
C C
Z = (A+D')•(B'+C+D)•(A'+B+C'+D) 1 0 1 1 1 0 1 1

B B
Z1 A Z2 A
1 0 1 1 1 0 1 1 Z1 = (A+B')•(A+D')•(B'+D')•(A'+B+C)
0 1 1 0 0 0 0 0 Z1 = (A•B•D') + (A•B'•C) + (A'•B'•D')
D D
0 1 1 1 0 0 0 0
C C
1 0 1 1 1 0 0 1

B B

Z1 = (A+B'+D)•(B+C+D')•(A+B+D')
Z2 = D'•(A+B')•(B'+C')

Elec 326 5.19 Karnaugh Maps Elec 326 5.20 Karnaugh Maps

5
5.4. Don't Care Entries
o Exercise: Derive minimal SOP and POS expressions
from the following Karnaugh maps. o Assignment of Values to Don't Care Entries.
Z Z Z Z A
A A A
X X 1 1 1 1 1 1 1 1
A A d 1 1 1 0 1 1 1
C C C C
d 0 1 0 0 0 0 0
B B
1 1 1 1 1 1 1 1 B B
0 0 0 0 0 0
0 0
B
1 0 0 1 1 0 0 1 Z = B'+A'•C Z = A•B'+B'•C' Z = B'
D D
1 0 0 0 1 0 0 0 Z A Z A
C 0 0 d 1 1 d d 1
1 1 0 0 1 1 0 0 0 0 d 0 0 0 d 0
D D
0 1 d d 1 1 0 d
C C
C B 0 1 d d 1 d d 1
B B

X= Y= Z = B•C + A•D' Z = (C+D')•(A'+B')

Elec 326 5.21 Karnaugh Maps Elec 326 5.22 Karnaugh Maps

5.5. Five- and Six-Variable Maps


o Minterm and Maxterm Lists with Don't Care Entries. o Five-Variable Maps.

SA,B,C(0,d1,d3,4,5) and PA,B,C(d1,2,d3,6,7)

SA,B,C(6,7,8,d10,d11,d12,d13,d14,d15)

PA,B,C(0,1,2,3,4,5,9,d10,d11,d12,d13,d14,d15)

Elec 326 5.23 Karnaugh Maps Elec 326 5.24 Karnaugh Maps

6
o Six-Variable Maps o Examples.
C
0 4 12 8 Z B B
1 5 13 9
F Z 1 0 0 0 1 0 0 0
E 3 7 15 11 C C
2 6 14 10 B' •C' • E' 0 0 1 1 0 0 1 1
0 4 12 8 16 20 28 24 E
D 0 0 1 1 0 0 1 1
C 1 5 13 9 17 21 29 25 D
F F 1 0 0 0 1 0 0 0
16 20 28 24 3 7 15 11 19 23 31 27 B•E
E E C C
17 21 29 25 2 6 14 10 18 22 30 26
F A
E 19 23 31 27
D D
18 22 30 26 C C Z = B'•C'•E'+B•E
D 32 36 44 40 48 52 60 56
C
48 52 60 56 33 37 45 41 49 53 61 57
F F A
B 49 53 61 57 35 39 47 43 51 55 63 59
F E E
E 51 55 63 59 A 34 38 46 42 50 54 62 58
50 54 62 58 D D
D B
C
Alternate Version of Six-Variable Map
32 36 44 40
33 37 45 41
F
E 35 39 47 43
34 38 46 42
A'B'D + CE + ABD + BD'E'
D
Six Variable Map Structure

Elec 326 5.25 Karnaugh Maps Elec 326 5.26 Karnaugh Maps

6.5. Timing Hazards


o Exercise: Draw a timing diagram for the following
circuit assuming an equal unit delay for each gate.
A X
Y
Z = (B+C)•(B+E•(A'+D+E)•(A+C+E) B

Y
Z = B•C + D

Elec 326 5.27 Karnaugh Maps Elec 326 5.28 Karnaugh Maps

7
o Static 1 hazards o There is a simple way to prevent the hazards using
Karnaugh maps. Z A
A=1 P
S 0 1 1 0
NS Z
Q
S 0 0 1 1
B=1
B
S
n The hazard occurs when the output is 1 before and after the
P transition.
NS
n It happens because one of the AND gates is holding the
Q output 1 before the transition and the other AND gate holds
Z
it 1 after the transition. The spike occurs if it is possible for
0 spike, static 1 hazard the first to turn off before the second turns on.
n This can happen anytime there are to adjacent squares on
n Without the delay in the gates, the output Z would be the Karnaugh map that are both 1 and not both covered by
constant at 1. a common loop. The hazard occurs in making a transition
from one square to the other.
n The spike is due to the gate delay and the fact that not
every path from on input to the output is the same length. n The way to prevent it is to put in an extra product term that
is 1 on both sides of the transition. On the Karnaugh map
this is a loop covering the two adjacent one squares.
Elec 326 5.29 Karnaugh Maps Elec 326 5.30 Karnaugh Maps

o Static 0 hazard
n The loop added to prevent the hazard is redundant and not
S
needed to realize the logical expression. Its only purpose is A=0 P P
to prevent the hazard. S
Z NS
Q
B=0 Q 1 spike, static 0 hazard
A
S Z
Z
B
n The static 0 hazard is caused by two OR
gates where one holds the output zero before the transition and the other after the
transition, and it is possible for them to both be 1 during the transition
n The fix is to put in an extra OR gate to hold the output zero during the
transition
n This technique will avoid all static 1 hazards if only one
variable is changed at a time.
n It is not possible to get a 1 spike from a 2-level AND-OR Z A A
S
network by changing only one variable. Why? 0 0 1 1
Z
0 1 1 0
B
S

Elec 326 5.31 Karnaugh Maps Elec 326 5.32 Karnaugh Maps

8
5.6. Tips and Tricks

o Hazards can frequently be ignored. If the signal Z o Use type 2 maps to plot from a truth table
above is not used during the transition, then we don't
care if it has a spike. o Use type 1 maps to plot expressions and read
expressions from a map.
o When a signal is used as the input to a flip-flop, it is
only sampled with the clock makes a transition. 5.7. Pitfalls
Therefore, if we can make sure that any spikes occur
at some other time, they will not be a problem.
o Forgetting that K-maps "wrap around"
o Forgetting that the 4 corners are adjacent
o Getting the complements reversed in reading POS
expressions from a K-map

Elec 326 5.33 Karnaugh Maps Elec 326 5.34 Karnaugh Maps

5.8. Review

o The labeling of Karnaugh maps and how to promotes


the simplification of logical expressions.
o Implicants and prime implicants.
o Implicates and prime implicates.
o Don’t care entries.
n Where do they come from?
n How can they be used to simplify logical expressions?
o Techniques for using Karnaugh maps to eliminate
static hazards
n Conditions under which this is possible.

Elec 326 5.35 Karnaugh Maps

You might also like