Lecture 4: Four Input K-Maps CSE 4: Components and Design Techniques for Digital Systems Fall 24 CK Cheng Dept. of Computer Science and Engineering University of California, San Diego
Outlines Boolean Algebra vs. Karnaugh Maps Algebra: variables, product terms, minterms, consensus theorem Map: planes, rectangles, cells, adjacency Definitions: implicants, prime implicants, essential prime implicants Implementation Procedures 2
4-input K-map A B C D AB CD 3
4-input K-map A B C D AB CD 4
4-input K-map Identify adjacent cells containing s What happens when we combine these cells? CD AB 5
Boolean Expression K-Map Variable x i and its compliment x i Product term P (Πx i * e.g. b c ) Two half planes Rx i, and Rx i Intersect of Rx i * for all i in P e.g. Rb intersect Rc Each minterm One element cell Two minterms are adjacent iff they differ by one and The two cells are only one variable, eg: neighbors abc d, abc d Each minterm has n adjacent minterms Each cell has n neighbors 6
Procedure for finding the minimal function via K-maps (layman terms). Convert truth table to K-map 2. Group adjacent ones: In doing so include the largest number of adjacent ones (Prime Implicants) CD AB 3. Create new groups to cover all ones in the map: create a new group only to include at least once cell (of value ) that is not covered by any other group 4. Select the groups that result in the minimal sum of products (we will formalize this because its not straightforward) 7
Reading the reduced K-map CD AB = AC + ABD + ABC + BD 8
Definitions: implicant, prime implicant, essential prime implicant Implicant: A product term that has non-empty intersection with on-set F and does not intersect with off-set R. Prime Implicant: An implicant that is not covered by any other implicant. Essential Prime Implicant: A prime implicant that has an element in on-set F but this element is not covered by any other prime implicants. 9
Definition: Prime Implicant. Implicant: A product term that has non-empty intersection with on-set F and does not intersect with off-set R. 2. Prime Implicant: An implicant that is not covered by any other implicant. Q: Is this a prime implicant? CD AB A. es B. No
Definition: Prime Implicant. Implicant: A product term that has non-empty intersection with on-set F and does not intersect with off-set R. 2. Prime Implicant: An implicant that is not covered by any other implicant. Q: Is this a prime implicant? CD AB A. es B. No
Definition: Prime Implicant. Implicant: A product term that has non-empty intersection with on-set F and does not intersect with off-set R. 2. Prime Implicant: An implicant that is not covered by any other implicant. CD AB Q: How about this one? Is it a prime implicant? A. es B. No 2
Definition: Prime Implicant. Implicant: A product term that has non-empty intersection with on-set F and does not intersect with off-set R. 2. Prime Implicant: An implicant that is not covered by any other implicant. CD AB Q: Is the red group a prime implicant? A. es B. No: Because it is covered by a larger group 3
Definition: Essential Prime Essential Prime Implicant: A prime implicant that has an element in on-set F but this element is not covered by any other prime implicants. AB CD Q: Is the blue group an essential prime? A. es B. No 4
Definition: Essential Prime Essential Prime Implicant: A prime implicant that has an element in on-set F but this element is not covered by any other prime implicants. AB CD Q: Is the blue group an essential prime? A. es B. No 5
Definition: Non-Essential Prime Non Essential Prime Implicant : Prime implicant that has no element that cannot be covered by other prime implicant Q: Which of the following reduced expressions is obtained from a non-essential prime for the given K-map? ab cd A. bc d B. d b C. ac D. abc E. ad 6
Definition: Non-Essential Prime Non Essential Prime Implicant : Prime implicant that has no element that cannot be covered by other prime implicant Q: Which of the following reduced expressions is obtained from a non-essential prime for the given K-map? ab cd A. bc d B. d b C. ac D. abc E. ad 7
Procedure for finding the minimal function via K-maps (formal terms). Convert truth table to K-map 2. Include all essential primes AB CD 3. Include non essential primes as needed to completely cover the onset (all cells of value one) 8
K-maps with Don t Cares A B C D AB CD 9
K-maps with Don t Cares A B C D AB CD 2
K-maps with Don t Cares A B C D AB CD = A + BD + C 2
Reducing Canonical expressions Given F(a,b,c,d) = Σm (,, 2, 8, 4) D(a,b,c,d) = Σm (9, ). Draw K-map ab cd 22
Reducing Canonical Expressions Given F(a,b,c,d) = Σm (,, 2, 8, 4) D(a,b,c,d) = Σm (9, ). Draw K-map ab cd 4 2 8 5 3 9 3 7 5 2 6 4 23
Reducing Canonical Expressions Given F(a,b,c,d) = Σm (,, 2, 8, 4) D(a,b,c,d) = Σm (9, ). Draw K-map ab cd 4 2 8 5 3 9 3 7 5 2 6 4 24
. Draw K-map 2. Identify Prime implicants 3. Identify Essential Primes Reducing Canonical Expressions ab cd 4 2 8 5 3 9 3 7 5 2 6 4 PI Q: How many primes (P) and essential primes (EP) are there? A. Four (P) and three (EP) B. Three (P) and two (EP) C. Three (P) and three (EP) D. Four (P) and Four (EP) 25
Reducing Canonical Expressions. Prime implicants: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) 2. Essential Primes: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) ab cd 4 2 8 5 3 9 3 7 5 2 6 4 PI Q: Do the E-primes cover the entire on set? A. es B. No 26
Reducing Canonical Expressions. Prime implicants: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) 2. Essential Primes: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) 3. Min exp: Σ (Essential Primes)=Σm (,, 8, 9) + Σm (, 2, 8, ) + Σm (, 4) f(a,b,c,d) =? ab cd 4 2 8 5 3 9 3 7 5 2 6 4 PI Q: Do the E-primes cover the entire on set? A. es B. No 27
Reducing Canonical Expressions. Prime implicants: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) 2. Essential Primes: Σm (,, 8, 9), Σm (, 2, 8, ), Σm (, 4) 3. Min exp: Σ (Essential Primes)=Σm (,, 8, 9) + Σm (, 2, 8, ) + Σm (, 4) f(a,b,c,d) = b c + b d + acd ab cd 4 2 8 5 3 9 3 7 5 2 6 4 PI Q: Do the E-primes cover the entire on set? A. es B. No 28
Another example Given F(a,b,c,d) = Σm (, 3, 4, 4, 5) D(a,b,c,d) = Σm (,, 3).Draw the K-Map ab cd 29
Another example Given F(a,b,c,d) = Σm (, 3, 4, 4, 5) D(a,b,c,d) = Σm (,, 3) ab cd 4 2 8 5 3 9 3 7 5 2 6 4 3
Reducing Canonical Expressions. Prime implicants: Σm (, 4), Σm (, ), Σm (, 3), Σm (3, ), Σm (4, 5), Σm (, 5), Σm (3, 5) 2. Essential Primes: Σm (, 4), Σm (4, 5) ab cd 4 2 8 5 3 9 3 7 5 2 6 4 3
Reducing Canonical Expressions. Prime implicants: Σm (, 4), Σm (, ), Σm (, 3), Σm (3, ), Σm (4, 5), Σm (, 5), Σm (3, 5) 2.Essential Primes: Σm (, 4), Σm (4, 5) 3.Min exp: Σm (, 4), Σm (4, 5), (Σm (3, ) or Σm (,3) ) f(a,b,c,d) = a c d + abc+ b cd (or a b d) ab cd 4 2 8 5 3 9 3 7 5 2 6 4 32
Reading [Harris] Chapter 2, 2.7 33