Download Karnaugh Maps - Digital System Design - Lecture Slides and more Slides Digital Systems Design in PDF only on Docsity!
Karnaugh Maps
Circuit Minimization
Algebraic manipulations can be used to simplify
Boolean expressions
As we've seen, this process is not always easy
Karnaugh maps (K-maps) provide an easy and
visual technique for finding the minimum cost SOP
(or POS) form for a Boolean expression
This technique has limitations. i.e. works for # inputs < 7 Not good for CAD tools, but good for teaching the idea of simplification
Visualizing the Combining Property
f(x1,x2) = m (0,1,3)
Canonical SOP:
f = x1'x2'+x1'x2+x1x = x1'x2'+x1'x2+x1x2+x1'x = x1'+x
A 2-variable Karnaugh map:
x1 x2 F 0 0 1 0 1 1 1 0 0 1 1 1
x x
minimum form: f = x1'+x
3 Variable Map
f(A,B,C) = m (1,2,6,7)
Minimum SOP is f = A B + B C' + A' B' C Cost = gates + fan-in = 4 + (7+3) = 14
B C
A
Gray Code: any two consecutive numbers differ in only a single bit
Full-Adder Carry-Out
Cout(A,B,Cin) = m (3,5,6,7)
Minimum SOP is Cout = A Cin + B Cin + A B Cost = 4 + 9 = 13
B Cin A
More 3 Variable Maps
B C
A
B C
A
A' B + A B' (A B)
A' + B
f =
f =
Full-Adder Sum
S(A,B,Cin) = m (1,2,4,7)
Minimum is S = A B' Cin' + A' B' Cin + A B Cin + A'B Cin' Can't reduce anything and stay in SOP form!
B Cin A
Sidebar: Gray Codes
A binary Gray code is a binary sequence such that
no two consecutive numbers differ by more that a
single bit
Gray codes have many uses in CS
2 bit Gray code: 00, 01, 11, 10 Note that this is circular 10, 00 again differs in only 1 bit These are called binary reflected Gray codes
3 bit Gray code: 000, 001, 011, 010, 110, 111, 101, 100
The Formal Karnaugh Map Method
1. Choose a 1 element
2. Find all maximal groups of 1's adjacent to that
element
Note: "box" must be a power of 2 in size
3. Repeat steps 1-2 for all 1 elements
4. Select all boxes for which a 1 is “covered” by only
that box
These boxes are essential!
5. For all 1's not covered by the essential boxes, select
the smallest number of other boxes that cover them
In case of a choice, select the largest box!
4 Variable Maps
f(A,B,C,D) = m (0,1,2,3,6,8,9,11,13,14)
f = A C' D + B C D' + B' C ' + B' D + A'B'
C D
A B
Terminology
An implicant is a product term in an SOP expression
(or a sum term in POS expression)
Implicants are always rectangular in shape and the # of 1's covered is a power of 2
A prime implicant is an implicant that is not fully
contained in some other larger implicant
B C
A
red implicant (but not prime) many more are not shown blue prime implicants (only two)
Essential Prime Implicants
An essential prime implicant is a prime implicant
that contains a 1 not included in any other prime
implicant
The minimum Boolean expression must use this term
A cover is a collection of implicants that accounts
for all valuations in which the function is “on” (e.g. 1)
Don’t Care Conditions
Many times there are incompletely specified
conditions
Valuations that can never occur, or for which we “don’t care what the device does”
Modeling such a device requires us to specify don’t
care conditions in those instances
Use X as a value to indicate we don't care what happens
Don't care situations are often called incompletely
specified functions
Example Using Don't Cares
f(A,B,C,D) = m (1,5,8,9,10) + d(3,7,11,15)
f = A B' + A' D
C D
A B
00 0 1 X 0
01 0 1 X 0
11 0 0 X 0
10 1 1 X 1