1 / 34

Logic and Computer Design Fundamentals Combinational Logic Circuits

Logic and Computer Design Fundamentals Combinational Logic Circuits Circuit Optimization, Two-Level Optimization, Map Manipulation References : Textbook (Appendix B), Logic and Computer Design Fundamentals (Chapters 1 and 2)

Download Presentation

Logic and Computer Design Fundamentals Combinational Logic Circuits

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logic and Computer Design Fundamentals • Combinational Logic Circuits • Circuit Optimization, Two-Level Optimization, Map Manipulation • References:Textbook (Appendix B), Logic and Computer Design Fundamentals (Chapters 1 and 2) • Original slides were prepared by Charles Kim and Thomas Kaminski This version was modified by HaidarSafa

  2. SOP and POS Observations • Canonical Forms (Sum-of-minterms, Product-of-Maxterms), or other standard forms (SOP, POS) differ in complexity • Boolean algebra can be used to manipulate equations into simpler forms. • Simpler equations lead to simpler two-level implementations • Questions: • How can we attain a “simplest” expression? • Is there only one minimum cost circuit? • The next part will deal with these issues.

  3. Circuit Optimization • Goal: To obtain the simplest implementation for a given function • Optimization is a more formal approach to simplification that is performed using a specific procedure or algorithm • Optimization requires a cost criterion to measure the simplicity of a circuit • Distinct cost criteria we will use: • Literal cost (L) • Gate input cost (G) • Gate input cost with NOTs (GN)

  4. D C B D C B B C D B Literal Cost • Literal – a variable or its complement • Literal cost – the number of literal appearances in a Boolean expression corresponding to the logic circuit diagram • Examples: • F = BD + A C + A L = 8 • F = BD + A C + A + AB L = • F = (A + B)(A + D)(B + C + )( + + D) L = • Which solution is best? 11 10

  5. B C D C B D B D C B B Gate Input Cost • Gate input costs - the number of inputs to the gates in the implementation corresponding exactly to the given equation or equations. (G - inverters not counted, GN - inverters counted) • For SOP and POS equations, it can be found from the equation(s) by finding the sum of: • all literal appearances • the number of terms excluding single literal terms,(G) and • optionally, the number of distinct complemented single literals (GN). • Example: • F = BD + A C + A G = 11, GN = 14 • F = BD + A C + A + AB G = , GN = • F = (A + )(A + D)(B + C + )( + + D) G = , GN = • Which solution is best? 18 15 17 14

  6. GN = G + 2 = 9 L = 5 G =L+ 2 = 7 B C A F • L (literal count): counts the AND inputs and the single literal OR input. C B • G (gate input count): adds the remaining OR gate inputs • GN(gate input count with NOTs): adds the inverter inputs Cost Criteria (continued) Example 1: • F = A + B C +

  7. B A A B C F A B C F C A C B Cost Criteria (continued) Example 2: • F = A B C + • L = 6; G = 8; GN = 11 • F = (A + )( + C)( + B) • L = 6; G = 9; GN = 12 • Same function and sameliteral cost • But first circuit has bettergate input count and bettergate input count with NOTs • Select it!

  8. Boolean Function Optimization • Minimizing the gate input (or literal) cost of a (a set of) Boolean equation(s) reduces circuit cost. We choose gate input cost. • Boolean Algebra and identities are used to minimize cost criteria values. • Drawbacks • using identities to simplify the expression is awkward because it lacks specific rules to predict each succeeding stepin the manipulative process and it can be difficult to determine whether the simplest expression has been achieved. • Introduce a graphical technique using Karnaugh maps (K-maps) • Some important questions: • When do we stop trying to reduce the cost? • Do we know when we have a minimum cost? • Treat optimum or near-optimum cost functions for two-level (SOP and POS) circuits first.

  9. Karnaugh Maps (K-map) • 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 of one variable • Alternative algebraic expressions for the same function are derivedby recognizing patterns of squares • The K-map can be viewed as a reorganized version of the truth table • Drawbacks? • the K-maps can handle up to 4 variables even though five or six variables can be drawn as well but are more cumbersome to use.

  10. Some Uses of K-Maps • Provide a means for: • Finding optimum ornear optimum • SOP and POS standard forms, and • two-level AND/OR and OR/AND circuit implementations for functions with small numbers of variables • Visualizingconcepts related to manipulating Boolean expressions, and • Demonstrating concepts used by computer-aided design programs to simplify large circuits Simplified expressions produced by a map are always in Sum of products or product of Sum form

  11. y = 1 y = 0 m m 0 = 1 = x = 0 x y x y m 2 = m 3 = x = 1 x y x y Two Variable Maps: Sum of Product • A 2-variable Karnaugh Map: • A function with 2 variables has 4 minterms • Note that minterm m0 and minterm m1 are “adjacent” and differ in the value of the variable y • Similarly, minterm m0 andminterm m2 differ inthexvariable. • Also, m1 and m3 differ in the x variableas well. • Finally, m2andm3differ in the valueof the variable y

  12. = + F ( x , y ) x y x y Two Variable Maps: Sum of Product Example: • Using the Boolean Algebra then F(x,y) = x • Using K-map for minimizing function F(x,y), the two adjacent cells containing 1’s can be combined using the Minimization Theorem. • then F(x,y) = x y = 1 y = 0 F = x y x 0 0 x = 0 1 x 1 x = 1 y

  13. Two Variable Maps: Sum of Product • How does combining squares simplifies Boolean expression: • Answer: Basic property possessed by adjacent squares • Any two adjacent squares placed horizontally or vertically ( but not diagonally) to form a rectangle correspond to minterms that differ in only one single variable • The single variable appears uncomplementedin one square and complemented in the other. • On a 2-variable map, any two Minterms in adjacent squares that are OREDtogether produce a product term of one variable. • Lets look at another example

  14. Two Variable Maps: Sum of Product • A k-map and Sum of Product Form • If F = X’Y + XY + XY’ = Y(X’ + X) + XY’ = Y + XY’ • By using distributive dual identity : X + YZ = (X+Y)(X+Z) • F = (Y + X) ( Y+Y’) ( identity 7) • F = Y + X • So how do we obtain simplified expression from map • F = X’Y + XY + XY’ = m1 + m2 + m3 • Two vertical 1’s adjacent; when combined give the variable Y • Two horizontal 1’s adjacent; when combined give the variable X y = 1 y = 0 x y Y F = X +Y x = 0 0 1 x = 1 1 x 1 X y

  15. yz=00 yz=01 yz=11 yz=10 x=0 m0 m1 m3 m2 x=1 m4 m5 m7 m6 Three Variable Maps • Three-variable K-map: The number of Minterms is 8. So a k-map for the three variables consists of eight squares • Where each minterm corresponds to the product terms: • Note that if the binary value for an index differs in one bit position, the minterms are adjacent on the K-Map • m0 and m2 are adjacent (same for m4 and m6)

  16. Three Variable Maps • How are these squares organized? • Answer: The number along the columns ; 00, 01, 11, 10do not follow the binary count sequence because we want only one bit to change value from one adjacent column to the next • On a 3-variable map, any two Minterms in adjacent squares that are ORED together produce a product term of two variables • E.g. X’YZ + X’YZ’ = X’Y(Z+Z’) = X’Y(1) = X’Y  one minterm

  17. y 0 3 x 2 1 x 4 7 6 5 z z z Three Variable Maps - Combining squares • By combining squares, we reduce number of literals in a product term, reducing the literal cost, thereby reducing the other two cost criteria • On a 3-variable K-Map: • Onesquare 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) = 1. y y z x 00 01 11 10 0 3 2 1 0 4 7 6 5 1 x z y

  18. Example Functions Example: • Simplifying it by hand F = X’YZ’ + X’YZ + XY’Z’ + XY’Z F = X’Y(Z’+Z) + XY’(Z’+Z) F = X’Y + XY’ • Using the K-map • 1) By convention , A “1” is marked in each minterm that represent the function F, others are left blank • 2) We explore the collection of squares on the map representing product terms for simplification ( i.e. rectangles) • NOTE: Rectangles that correspond to product term are restricted to certain number of squares that are power of 2 • 3) the goal is to find the fewest rectangles that include all minterms with 1’s ( this will give the fewest product terms)

  19. Example Functions Example: • Simplifying it ssing the K-map • A “1” is marked in each minterm that represent the function F • Explore the collection of squares representing product terms and combine the power of two adjacent ones for simplification • Since these two rectangles include all of the 1’s  the logical sum gives the simplified expressionF = X’Y + XY’ y y z X’Y x 00 01 11 10 0 3 1 1 2 XY’ 1 0 1 4 7 6 5 1 1 x z

  20. Three-Variable Maps • Question: How about two squares in the map that do not touch each other but considered adjacent • F = X’Y’Z + X’YZ’ • = X’Z’(Y’+Y) • = X’Z’ y x z

  21. Three-Variable Maps • Important: Because minterms differ by one variable, also four square rectangles can be simplified • = X’Y’Z’ + X’YZ’ + XY’Z’ + XYZ’ • = X’Z’(Y’+Y) + XZ’(Y+Y’) • = Z’(X+X’) • = Z’ ( so the logical sum reduces to a simple variable) y x z

  22. Three-Variable Maps • Question: Can we include 1’s already combined in the formation of new rectangles? • Answer: yes y F = X’Y’ + Y x z y So in general, as more squares are combined, we obtain a product term with fewer literals F = X’ + Y x z

  23. Three-Variable Maps-Example • So remaining single square representing m5 is combined with an adjacent square that is being used once • This is not only permissible, but rather desirable • Since the two adjacent squares give the two literal terms XY’ while the single square represent 3 literals minterm XY’Z Z’ F = Z’ + XY’ F = Z’ + XY’Z

  24. Three-Variable Maps • Sometimes there might be two possible simplified solutions i.e. • = X’Z + X’Z’ + XY’ or X’Z + X’Z’

  25. Four Variable Maps • If we have a function of 4 variables then we have 16 mintermsand we require a map consisting of 16 squares • Note: only one bit of the binary number changes value between any two adjacent cols and rows

  26. Four Variable Terms • The method used to simplify 4 variables function is similar to that used to simplify 3-variable functions • The combination of squares that can be chosen during the simplification process are as follows: • One square represents a minterm of four literals i.e. XY’ZW’ • A rectangle of twosqaures product term of three literals • A rectangle of foursqaures  product term of two literals • A rectangle of eightsqaures  product term of one literal • A rectangle of sixteen sqaures  function = 1 i.e. No gate

  27. Y 2 1 3 0 6 5 7 4 X 13 12 15 14 W 9 8 11 10 Z Four-Variable Maps- Example Shapes of Rectangles • An interesting product term that is often misused is combination of 1’s on the four corners of the map = X’Z’

  28. 2 1 3 0 6 5 7 4 13 12 15 14 9 8 11 10 Four-Variable Maps: Example Shapes of Rectangles Y X W Z

  29. Four-Variable Maps: Example • Simplify the Boolean Function: • F = Y’ + W’Z’ + XZ’ y x w z

  30. Four-Variable Maps: Example • If a function is not expressed as a sum of minterms, we can use the map to obtain the minterms of the function and then simplify the function • Simplify the Boolean Function: • F= (A, B, C, D) = A’B’C’ + B’CD’ + AB’C’ + A’BCD’

  31. Four-Variable Maps: Example F=(A, B, C, D) = A’B’C’ + B’CD ’ + AB’C’ + A’BCD’ AB’CD’ X010 0010 1010 AB’C’D 100X 1000 1001 1 1 1 1 A’B’C’D 000X 0000 0001 1 1 1

  32. Four-Variable Map Simplification = S F(W, X, Y, Z) (0, 2,4,5,6,7, 8,10,13,15 ) m F = XZ + X'Z'

  33. Four-Variable Map Simplification = S F(W, X, Y, Z) (3,4,5,7,9,1 3,14,15 ) m F = W' X Y' + W' Y Z + WXY + WY'Z

  34. Don't Cares in K-Maps • Sometimes a function table or map contains entries for which it is known: • the input values for the minterm will never occur, or • The output value for the minterm is not used • In these cases, the output value need not be defined • Instead, the output value is defined as a “don't care” • By placing “don't cares” ( an “x” entry) in the function table or map, the cost of the logic circuit may be lowered. • Example 1: A logic function having the binary codes for the BCD digits as its inputs. Only the codes for 0 through 9 are used. The six codes, 1010 through 1111 never occur, so the output values for these codes are “x” to represent “don’t cares.” • each don’t care “x” entry may take on either a 0 or 1 value in resulting solutions. For example, an “x” may take on value “0” in an SOP solution and value “1” in a POS solution, or vice-versa.

More Related