Universit of Wisconsin - Madison ECE/Comp Sci 352 Digital Sstems Fundamentals Charles R. Kime Section Fall 200 Chapter 2 Combinational Logic Circuits Part 5 Charles Kime & Thomas Kaminski Boolean Function Simplification S Reducing the literal cost of a Boolean Epression leads to simpler circuits. S Simpler circuits are less epensive to implement. S Boolean Algebra can help us minimie literal cost. S When do we stop tring to reduce the cost? S Do we know when we have a minimum? S We will introduce a sstematic wa to arrive a a minimum cost, two-level POS or SOP circuit. Chapter 2-Part 5 2
Karnaugh Maps (K-map) S A K-map is a collection of squares Each square represents a minterm The collection of squares is a graphical representation of a Boolean function Adjacent squares differ in the value (complement) of one variable Alternative algebraic epressions for the same function are derived b recogniing patterns of squares S The K-map can be viewed as a reorganied version of the truth table S The Karnaugh Map can be viewed as a topologicall-warped Venn diagram as used to visualie sets Chapter 2-Part 5 3 Some Uses of K-Maps S Provide a means for finding optimum: (Simple) SOP and POS standard forms, and (Small) two-level AND/OR and OR/AND circuits S Visualie concepts related to manipulating Boolean epressions S Demonstrate concepts used b computeraided design programs to simplif large circuits Chapter 2-Part 5 4 2
Two Variable Maps S A Two variable Karnaugh Map: = 0 = Note that minterm m0 and minterm m are "adjacent = 0 m 0 = m = and differ in the value of the variable. = m 2 = m 3 = Similarl, minterm m0 and minterm m2 differ in the variable. Also, m and m3 differ in the variable as well. Finall, m2 and m3 differ in the value of the variable Chapter 2-Part 5 5 K-Map and Truth Tables S S The K-Map is just a different form of the truth table. Eample Two Variables: We choose a,b,c and d from the set {0,} to implement a particular function, F(,). Function Table K-Map Input Values (,) Function Value F(,) 0 0 a 0 b 0 c d = 0 = = 0 a b = c d Chapter 2-Part 5 6 3
K-Map Function Representation S Eample: F(,) = F = = 0 = = 0 0 0 = S For function F(,), the two adjacent cells containing s can be combined using the Minimiation Theorem: F (, ) = + = Chapter 2-Part 5 7 K-Map Function Representation S Eample: G(,) = + G = + = 0 = = 0 0 = For G(,), two pairs of adjacent cells containing s can be combined using the Minimiation Theorem: ( + )( + + ) = G (, ) = + Duplicate Chapter 2-Part 5 8 4
Three Variable Maps S A three-variable K-map: =00 =0 = =0 S S Where each minterm corresponds to the product terms below: =00 =0 = =0 Note that if the binar value for an inde differs in one bit position, the minterms are adjacent on the Karnaugh Map =0 m 0 m m 3 m 2 = m 4 m 5 m 7 m 6 =0 = Chapter 2-Part 5 9 Alternative Map Labeling S Map use largel involves: Entering values into the map, and Reading off product terms from the map. S Alternate labelings are useful: 0 3 2 4 5 7 6 00 0 0 0 0 3 2 4 5 7 6 Chapter 2-Part 5 0 5
Eample Functions S B convention, we represent the minterms of F b a "" in the map and leave the minterms of blank S Eample: 0 3 2 F(,, ) = Σm(2,3,4,5) 4 5 7 6 S Eample: G(a, b,c) = Σ m (3,4,6,7) 0 3 2 4 5 7 6 F Chapter 2-Part 5 Combining Squares S B combining squares, we reduce the representation for a term, reducing the number of literals in the Boolean equation. S On a three-variable K-Map: One square represents a minterm with three variables Two adjacent squares represent a product term with two variables Four adjacent terms represent a product term with one variable Eight adjacent terms is the function of all ones (no variables) =. Chapter 2-Part 5 2 6
Eample: Combining Squares Eample: Let 4 5 7 6 Appling the Minimiation Theorem three times: F(,, ) = + + + = + = Thus the four terms that form a 2 2 square correspond to the term "". F = Σm(2,3,6,7) 0 3 2 Chapter 2-Part 5 3 Three-Variable Maps S Reduced literal product terms for SOP standard forms correspond to rectangles on K-maps containing cell counts that are powers of 2. S Rectangles of 2 cells represent 2 adjacent minterms; of 4 cells represent 4 minterms that form a pairwise adjacent ring. S Rectangles can be in man different positions on the K-map since adjacencies are not confined to cells trul net to each other. Chapter 2-Part 5 4 7
Three-Variable Maps S Topological warps of 3-variable K-maps that show all adjacencies: Venn Diagram T Clinder 0 Y 2 4 X 6 7 5 3 Z Chapter 2-Part 5 5 Three-Variable Maps S Eample Shapes of Rectangles: 0 3 2 4 5 7 6 Chapter 2-Part 5 6 8
Three Variable Maps K-Maps can be used to simplif Boolean functions b sstematic methods. Terms are selected to cover the "ones" in the map. Eample: Simplif F(,, ) m(,2,3,5,7) = Σ F(,, ) = + Chapter 2-Part 5 7 Three-Variable Map Simplification S F(X, Y, Z) = Σm(0,,2,4,6,7) Chapter 2-Part 5 8 9
Four Variable Maps S Map and location of minterms: Y 0 3 2 5 6 4 7 2 3 5 4 X W 8 9 0 Z Chapter 2-Part 5 9 Four Variable Terms S Four variable maps can have rectangles corresponding to: A single one = 4 variables, (i.e. Minterm) Two ones = 3 variables, Four ones = 2 variables Eight ones = variable, Siteen ones = ero variables (i.e. Constant "") Chapter 2-Part 5 20 0
Four-Variable Maps S Eample Shapes of Rectangles: Y 0 3 2 5 6 4 7 2 3 5 4 X W 8 9 0 Z Chapter 2-Part 5 2 Four-Variable Map Simplification S F(W, X, Y, Z) m(0, 2,4,5,6,7,8,0,3,9) = Σ Chapter 2-Part 5 22
Four-Variable Map Simplification S F(W, X, Y, Z) m(3,4,5,7,3,4,5,7) = Σ Chapter 2-Part 5 23 Sstematic Simplification A Prime Implicant is a product term obtained b combining the maimum possible number of adjacent squares in the map. A prime implicant is called an Essential Prime Implicant if it is the onl prime implicant that covers (includes) one or more minterms. Prime Implicants and Essential Prime Implicants can be determined b inspection of a K-Map. A set of prime implicants that "covers all minterms" means, for each minterm of the function, at least one prime implicant in the set of prime implicants includes the minterm. Chapter 2-Part 5 24 2
Eample of Prime Implicants B D BD A AB S Find ALL Prime Implicants D AD CD C BC B ESSENTIAL Prime Implicants C B D BD A D B Chapter 2-Part 5 25 Prime Implicant Practice S F(A, B,C, D) = Σm(0,2,3,8,9,0,,2, 3,4,5) Chapter 2-Part 5 26 3
Sstematic Approach (Suppl. 2). Find all PIs of the function F. 2. Select all essential PIs, checking off included minterms. 3. Find all less than PIs and delete those that are less than, but not equivalent to, at least one other PI.* (As a result, some of the other unselected PIs ma become essential.) 4. Repeat 2 and 3 until no more less than PIs appear. 5. Find equivalent PIs and select arbitraril one PI from each set of equivalent PIs, checking off included minterms. 6. If minterms remain unchecked and no PI less than relations can be obtained, then a cclic structure eists. For a cclic structure, (a) arbitraril select a PI and repeat steps through 6, and (b) delete the same PI selected and repeat steps through 6. Compare literal cost of the solutions generated and select the minimum literal cost cover. 7. Discard an redundant (unused) PIs. *Correction to Supplement 2 Chapter 2-Part 5 27 Other PI Selection S Once the Essential Prime Implicants are selected, we need to "prune" the solution set further. To do this, we determine which can be eliminated b finding Less Than PIs and Redundant PIs. Less Than PIs: PI i is said to be Less Than PI j if PI i contains at least as man literals as PI j and PI j covers at least all of the as et uncovered minterms that PIi covers. Equivalent PIs: A set of PIs which are pair-wise less than each other. Secondar Essential PIs: Once the less than PIs are removed from consideration, new PIs become essential and the are called Secondar Essential PIs. Redundant PIs: These are PIs whose minterms have been completel covered b the PIs selected and are removed from consideration. Chapter 2-Part 5 28 4
Eample 2 from Supplement Select Essential PIs: Eliminate Less Than Pis: w w Chapter 2-Part 5 29 Eample 2 (Continued) Select Secondar Essential PIs: Eliminate Redundant PIs: w w Chapter 2-Part 5 30 5
Another Eample S G(A, B,C, D) = Σm(0,2,3,4,7,2,3,4, 5) Chapter 2-Part 5 3 Five Variable or More K-Maps For five variable problems, we use two adjacent K-Maps. It becomes harder to visualie adjacent minterms for selecting PIs. You can etend the problem to si variables b using four K- Maps. v=0 v= w w Chapter 2-Part 5 32 6
Don't Cares in K-Maps S Sometimes a function table contains entries for which it is known the input values will never occur. In these cases, the output val ue need not be defined. B placing a don't care in the function table, it ma be possible to arrive at a lower cost logic circuit. S Don't cares are usuall denoted with an "" in the K-Map or function table. S Eample of Don't Cares - A logic function defined on 4-bit variables encoded as BCD digits where the four-bit input variables never eceed 9, base 2. Smbols 00, 0, 00, 0, 0, and will never occur. Thus, we DON'T CARE what the function value is for these combinations. S Don't cares are used in minimiation procedures in such a wa that the ma ultimatel take on either a 0 or value in the result. Chapter 2-Part 5 33 Eample: BCD 5 or More w S A function F(w,,,) which is defined as "5 or greater" over a BCD input, as below. Don't cares are on non-bcd values. S F (w,,,) = w + + 0 0 0 0 0 0 3 2 4 5 7 6 X X X 2 3 5 4 8 9 0 X X X S This is slightl lower in cost than F2 where the don't cares are required to be "0". F 2 (w,,, ) = w + w + w S For this particular function, note that the literal cost of the complement of F (w,,,), meaning "4 or less", is not changed b using the don't cares. Chapter 2-Part 5 34 7
Product of Sums Eample S F(A, B,C, D) = Σm (3,9,,2,3,4,5) + Σd (,4,6) S Use F and take complement of result: Chapter 2-Part 5 35 8