**preview**has

**blurred**sections. Sign up to view the full version! View Full Document

**Unformatted text preview: **EC262 Topic 5: The Three-Input Karnaugh Map Last week we learned how to simplify digital logic circuits by simplifying the Boolean expressions that represented these circuits. We simplified the Boolean expressions using Boolean algebra, and, particularly, the Table of Fun located on the inside cover of your text. Even though simplifying Boolean expressions using Boolean algebra provides hours of fun for bored midshipmen, it has some drawbacks. First, there is no clear algorithm to follow; becoming good at simplifying expressions requires intuition that is gained only through experience in solving many problems. Second, it is very easy to make a simple copying mistake (e.g., forgetting to include a complement sign on one of the literals as we go from step 17 to step 18 of our simplification process). Third, we often can't be sure we have simplified an expression as much as possible (which is why, on homework, quizzes and exams, you are told, for example, to "reduce the expression to three terms with eight literals"). Fortunately, we have much more convenient approach to simplifying digital logic circuits. Three-Input Karnaugh Maps A digital logic circuit with three separate inputs (let's call them x, y and z) has 23 = 8 possible input combinations: 000, 001, 010, 011, 100, 101, 110, 111. In other words, the truth table for this circuit will have eight lines. Each of these possible input combinations represents a minterm. For instance, the input combination 000 represents the minterm _______ and the input combination 101 represents the minterm _____. There will, of course, be an output for each of the eight possible input minterm combinations. A very helpful device for minimizing digital logic circuits is the Karnaugh map (K-map, for short). The K-map is a table where the rows and columns (together) account for all possible inputs to logic circuit. The outputs are displayed in a three-input K-map that is organized as follows: xy z 0 1 (Note that the top row is arranged in the order from left to right: memorize this order. Note that the order is NOT 00 01 10 11 .) 00 01 11 10. Take a moment to 00 01 11 10 The entry in each table cell corresponds to the output for the inputs specified by the row and column. Within each of the eight squares of the K-map, we place the output (0 or 1) that corresponds to the input minterm. From Introduction to Logic Design, Alan Marcovitz, McGraw Hill, 2010 Example. Suppose a digital logic circuit with three inputs (x, y , z) has the following Boolean expression: x' y'z' + x' y'z + x ' yz ' + xyz ' What is the K-map for this circuit? xy z 0 1 1 00 01 11 10 So...what do we do with this? We look for groups of adjacent 1's, where the grouping can be in the same row or the same column. When looking for adjacent 1's, we consider that the table rows and columns wrap around. Find all groupings in the table above. xy z 0 1 1 1 1 0 00 01 11 1 0 10 0 0 Now, the idea is to select the fewest groups that cover all the cells that have a 1. Look at the left red circle. It corresponds to the terms x ' y ' z ' + x ' y ' z . But this can be rewritten as: Thus, these two terms together can be expressed as What can the red circle on the right be rewritten as? What can the green circle be rewritten as? Do we need to include this last term? What is a simpler way of implementing x ' y ' z ' + x' y'z + x ' yz ' + xyz ' ? Example. Suppose a digital logic circuit with three inputs (x, y , z) has the following Boolean expression: x' y'z' + xy ' z ' + x ' yz + xyz Simplify this expression using a K-map. First, write the K-map: xy z 0 1 Now, the idea is to find pairs of adjacent 1's in such a way that we select the fewest groups that cover all the cells that have a 1. Also, remember that when looking for adjacent 1's, we consider that the table's rows and columns wrap around. 00 01 11 10 Thus, the original expression can be reduced to Note that we can do this simplification mechanically without even thinking of the Boolean algebra: When we group two adjacent cells, we can simply drop the variable that changes its value between the two cells. So, when we pair the 1 in the top-left corner corresponding to x ' y ' z ' with the 1 in the top-right corner corresponding to xy ' z ' , we note that the variable that changes between these two terms is x...so we can just drop that literal and reduce these two cells to y ' z ' . 2 Example. Suppose that a logic circuit has the following truth table: x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z 0 1 0 1 0 1 0 1 Output 0 0 0 1 0 1 1 1 Construct the K-map for this circuit and use the K-map to minimize this circuit. xy z 0 1 xy z 0 1 A simpler circuit is: The picture below emphasizes some of the various options for grouping pairs of 1's in a three-input K-map. 00 01 11 10 00 01 11 10 From Introduction to Logic Design, Alan Marcovitz, McGraw Hill, 2010 So, again, remember that a pair of adjacent 1's will correspond to a product term with one variable missing...the variable that changed value between the two terms. 3 Example. Suppose that a logic circuit has the following truth table: x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z 0 1 0 1 0 1 0 1 xy z 0 1 If we group If we group So, our simplified circuit is ________________ Yes... and we can modify the K-map technique to do this: Output 0 1 0 1 0 1 0 1 Construct the K-map for this circuit and use the K-map to simplify the circuit. 00 01 11 10 So, for the above K-map, we could immediately group as: xy z 0 1 This immediately reduces to just: When we group four 1's together, we will obtain a product term with... Which variables? Example. We want to design a 3-input digital logic circuit that will output a 1 if inputs x and y are both 1 or if input x is 1 and inputs y and z are both 0. Show the truth table and the K-map, and simplify the Boolean expression using the K-map. The truth table is 00 01 11 10 4 What is the Boolean expression expressed in canonical SOP form? Suppose you could use gates that support any number of inputs. How many logic gates would be needed to directly implement this Boolean expression? Now, show the K-map. xy z 0 1 What simpler Boolean expression results from the K-map? Draw the logic circuit. 00 01 11 10 Note that this simpler circuit only requires Example. Full Adder Consider a digital logic circuit to add three bits together. Calling the three inputs A, B and C, the truth table is A B C Carry Sum 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 1 0 0 1 Show the K-map for the Carry bit, and simplify the Boolean expression to derive a simpler implementation. AB C 0 1 This simplifies to: 00 01 11 10 5 The logic circuit for the Carry bit is: A B Carry C What is the K-map for the Sum bit? AB C 0 1 Can this be simplified? You should convince yourself that the Sum bit can be implemented by two XORs. A B C 00 01 11 10 Example. Your friend is a math major who is taking a logic course. In the study of logic, the implication operator, denoted , is often used. The truth table for ( p q ) r is shown below. p 0 0 0 0 1 1 1 1 q 0 0 1 1 0 0 1 1 r 0 1 0 1 0 1 0 1 ( p q) r 0 1 0 1 1 1 0 1 Determine the canonical SOP Boolean expression for this truth table. Draw the Karnaugh map for this truth table. pq r 0 1 Using your Karnaugh map, determine the simplest Booleans expression that can represent this truth table. 00 01 11 10 6 Sketch the logic circuit for the Boolean expression you developed. Use only NOT, AND and OR gates. Suppose you only have NOT and AND gates available (i.e., you have no OR gates). Redesign you logic circuit from part (d) using only NOT and AND gates. Example (from Marcovitz) Draw the K-Map that corresponds to the Boolean expression: F = AB' + AC + A'BC' Start with the empty K-map: AB C 0 1 00 01 11 10 AB C 0 1 00 01 11 10 AB C 0 1 00 01 11 10 AB C 0 1 00 01 11 10 7 Terminology. Now that we have gained a heuristic appreciation for the use of K-maps, let's formalize the terminology. An implicant of a Boolean function is any product term that can be used in an SOP expression for the function. In a K-map, an implicant is any group of one, two, four or eight 1's that form a rectangle. Our goal is to choose the minimum number of implicants such that all 1's of the K-map are included (covered by) at least one of the implicants. Example. List all the implicants in the K-map below. AB C 0 1 00 1 0 01 1 1 11 0 0 10 1 0 A prime implicant is an implicant that is not completely contained in any other implicant. What are the prime implicants in the K-map shown above? A essential prime implicant is a prime implicant that includes at least one 1 that is not included in any other prime implicant. What are the essential prime implicants in the K-map shown above? Restated using this terminology, our procedure to use a K-map to simplify a Boolean expression is: Find all essential prime implicants. Circle these on the K-map. These will be in the final minimal SOP expression Find enough prime implicants to sweep up all the remaining 1's in the K-map. Accomplish this by attempting to first choose prime implicants that include as many 1's as possible, while avoiding leaving isolated 1's. Using this procedure, what is the minimum SOP expression for the K-map above? 8...

View Full Document