Guest Lecture by Kyle Tietz CprE 281: Digital Logic Guest Lecture by Kyle Tietz http://www.ece.iastate.edu/~alexs/classes/
Karnaugh Maps CprE 281: Digital Logic Iowa State University, Ames, IA Copyright © 2013
Administrative Stuff HW4 is out It is due on Monday Sep 23 @ 4pm. Please write clearly on the first page (in block capital letters) the following three things: Your First and Last Name Your Student ID Number Your Lab Section Letter
Administrative Stuff Exam 1 on Monday Sep 30. Details to follow. Homework Office Hours Pratik Mishra TLA M 5:30-7:30pm F 2:00-4:00pm
Motivation Best approach for simplified logic expression? How do we guarantee we have reached minimum SOP/POS representation?
Karnaugh Map (K-map) View function in pictoral form Same information as truth table Easier to group minterms x x 1 2 x 1 x 2 m 1 1 m m m 1 2 1 m 2 1 m m 1 3 1 1 m 3 (a) Truth table (b) Karnaugh map
Minterms x x x x m m m m m 1 1 m 1 1 1 m 1 1 1 1 m 1 1 1 1 2 1 2 1 2 3 1 2 3 m 1 1 m 1 1 1 1 m 1 1 2 1 1 m 1 1 1 3
Minterm Example x x x x m m m m m + m 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 m m m m m + m 1 2 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Minterm Example _ x1x2 + x1x2 = x2 x x x x m m m m m + m 1 1 1 1 1 1 1 1 2 3 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 _ x1x2 + x1x2 = x2
Two-Variable K-map (a) Truth table (b) Karnaugh map x x x x m 1 1 m m 2 x 1 x 2 m 1 1 m m m 1 2 1 m 2 1 m m 1 3 1 1 m 3 (a) Truth table (b) Karnaugh map
Example x x 1 2 1 1 1 1 1 1 1
1. Draw Map x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1
2. Fill Map x x 1 2 x 1 x 2 1 1 1 1 m m 2 1 1 m m 1 3 1 1 1
2. Fill Map x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1
3. Group x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1
3. Group x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1
3. Group x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1
4. Write Expression x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1
4. Write Expression x x 1 2 x 1 x 2 1 1 1 1 1 1 1 1 1 1 1 1 _ x1 + x2
Grouping x 1 x 1 x 2 x 2 1 1 1 1 1 1 m0 m1
Grouping x 1 x 1 x 1 x 2 x 2 x 2 1 1 1 1 1 + = 1 1 1 1 1
Grouping + = m0 + m1 = m0 + m1 x x x x x x 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 + = 1 1 1 1 1 m0 + m1 = m0 + m1
Grouping + = m0 + m1 = m0 + m1 x x x x x x 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 + = 1 1 1 1 1 m0 + m1 = m0 + m1
Grouping + = m0 + m1 = m0 + m1 _ _ _ _ + = x1x2 x1x2 x1 x x x x x x 1 1 1 1 1 1 + = 1 1 1 1 1 m0 + m1 = m0 + m1 _ _ _ _ x1x2 + x1x2 = x1
Grouping Group with rectangles Both sides a power of 2: 1x1, 1x2, 2x1, 2x2, 1x4, 4x1, 2x4, 4x2, 4x4 Can use same minterm more than once Can wrap around edges of map
Writing Expression Examine group and see which variables are constant 1 x 2 _ 1 x1 is constant 1 1 1
Three-variable K-map
Three-variable K-map Notice placement of Variables Binary pair values Minterms
Gray Code Sequence of binary codes Vary by only 1 bit 000 001 011 010 110 111 101 100 00 01 11 10
Three-variable K-map
Example x 1 2 3 00 01 11 10 f x 1 3 2 + =
Tips Label rows / columns with variable names Write out gray codes
Four-variable K-map
Example x x 1 2 x x 3 4 00 01 11 10 00 1 1 01 1 1 11 1 1 10 1 1
Example x x 1 2 x x 3 4 00 01 11 10 00 1 1 01 1 1 11 1 1 10 1 1
Example x x x x 00 01 11 10 00 1 1 x x x 01 1 1 x x x 11 1 1 x x x 10 2 x x 3 4 00 01 11 10 00 1 1 x x x 1 3 4 01 1 1 x x x 2 3 4 11 1 1 x x x 1 3 4 10 1 1 x x x 2 3 4
Example x x x x 00 01 11 10 00 1 1 x x x 01 1 1 x x x 11 1 1 x x x 10 2 x x 3 4 00 01 11 10 00 1 1 x x x 1 3 4 01 1 1 x x x 2 3 4 11 1 1 x x x 1 3 4 10 1 1 x x x 2 3 4 x x x x x x 1 2 4 1 2 4 x x x x x x 1 2 3 1 2 3
Example POS minimization of f = M(0, 1, 4, 8, 9, 12, 15) ( ) ( ) ( ) 3 4 00 01 11 10 x 3 4 + ( ) x 2 3 + ( ) x 1 2 3 4 + ( ) POS minimization of f = M(0, 1, 4, 8, 9, 12, 15)
More Examples
Next Time… Minimization
Questions?
THE END