CS 140 Lecture 4 Combinational Logic KMap Professor
CS 140 Lecture 4 Combinational Logic: K-Map Professor CK Cheng CSE Dept. UC San Diego
Part I. Combinational Logic – Implementation • K-map
4 -variable K-maps Id a b c d 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 f (a, b, c, d) 0 0 1 1
Corresponding K-map b 0 4 0 1 0 5 0 3 c 2 12 1 1 0 6 0 13 0 7 8 1 1 9 0 15 14 1 1 0 11 10 a f (a, b, c, d) = c 1 1 d
Another example w/ 4 bits: Id a b c d 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 f (a, b, c, d) 1 1 1 0 0 0 1 0
Corresponding 4 -variable K-map b 0 1 1 1 4 5 0 0 12 13 8 0 9 0 1 - 3 0 7 0 15 0 11 0 2 1 6 0 14 1 10 - c a f (a, b, c, d) = b’c’ + b’d’ + acd’ d
Boolean Expression K-Map Variable xi and its compliment xi’ Two half planes Rxi, Rxi’ Product term P (PXi* e. g. b’c’) Intersect of Rxi* for all i in P (Rb’ intersect Rc’) U Each minterm Two minterms are adjacent iff they differ by one and only one variable, eg: abc’d, abc’d’ 1 -cell Each minterm has n adjacent minterms Each 1 -cell has n neighbors The two 1 -cells are neighbors
Procedure Input: Two sets of F R D 1) Draw K-map. 2) Expand all terms in F to their largest sizes (prime implicants). 3) Choose the essential prime implicants. 4) Try all combinations to find the minimal sum of products. (This is the most difficult step)
4 -input K-map
4 -input K-map
K-maps with Don’t Cares
K-maps with Don’t Cares
Example Given F = Sm (0, 1, 2, 8, 14) D = Sm (9, 10) 1. Draw K-map 0 1 3 c 2 b 1 1 0 1 4 5 7 6 0 0 12 13 15 14 8 0 9 0 0 1 11 10 a 1 0 - d
2. Prime Implicants: Largest rectangles that intersect On Set but not Off Set that correspond to product terms. Sm (0, 1, 2, 9), Sm (0, 2, 8, 10), Sm (10, 14) 3. Essential Primes: Prime implicants covering elements in F that are not covered by any other primes. Sm (0, 1, 8, 9), Sm (0, 2, 8, 10), Sm (10, 14) 4. Min exp: Sm (0, 1, 8, 9) + Sm (0, 2, 8, 10) + Sm (10, 14) f(a, b, c, d) = b’c’ + b’d’+ acd’
Another example Given F = Sm (0, 3, 4, 15) D = Sm (1, 13) 1. Draw K-map 0 1 3 c 2 b 1 1 0 4 5 7 6 1 0 0 0 12 13 15 14 8 0 9 1 1 11 10 a 0 0 0 d
2. Prime Implicants: Largest rectangles that intersect On Set but not Off Set that correspond to product terms. E. g. Sm (0, 4), Sm (0, 1), Sm (1, 3), Sm (3, 11), Sm (14, 15), Sm (11, 15), Sm (13, 15) 3. Essential Primes: Prime implicants covering elements in F that are not covered by any other primes. E. g. Sm (0, 4), Sm (14, 15) 4. Min exp: Sm (0, 4), Sm (14, 15), ( Sm (3, 11) or Sm (1, 3) ) f(a, b, c, d) = a’c’d’+ abc+ b’cd (or a’b’d)
- Slides: 16