lecture 3 incompletely specified functions and k maps
play

Lecture 3: Incompletely Specified Functions and K Maps CSE 140: - PowerPoint PPT Presentation

Lecture 3: Incompletely Specified Functions and K Maps CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1


  1. Lecture 3: Incompletely Specified Functions and K Maps CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1

  2. Definitions • Literals x i or x i ’ • Product Term x 2 x 1 ’ x 0 • Sum Term x 2 + x 1 ’ + x 0 • Minterm of n variables: A product of n literals in which every variable appears exactly once. • Maxterm of n variables: A sum of n literals in which every variable appears exactly once. 2

  3. Incompletely Specified Function • Situations where the output of a switching function can be either 0 or 1 for a particular combination of inputs • This is specified by a don’t care in the truth table For example: Id a b f (a, b) 1) The input does not happen. 0 0 0 1 1 0 1 0 2) The input happens, but the 2 1 0 1 output is ignored. 3 1 1 X: don’t care Example: - Decimal number 0… 9 uses 4 bits. (1,1,1,1) does not happen. 3

  4. Consider a circuit that produces the difference between two inputs only if the second input is less than or equal to the first input. Let’s describe the truth table: Id a b g(a,b,c) 0 0 0 0 1 0 1 X 2 1 0 1 3 1 1 0 4

  5. How to completely specify the truth table in canonical form? We have three types of output which divides the input space into three sets: Onset F : All the input conditions for which the output is 1 Offset R: All the input conditions for which the output is 0 Don’t care D: All the input conditions for which the output is a ‘don’t care’ Id a b g(a,b,c) Which of the following is needed 0 0 0 0 to express a Boolean function?: 1 0 1 X A. Any one of F, R, D 2 1 0 1 B. Any two of F, R, D 3 1 1 0 C. All three sets: F, R, D 5

  6. Boolean Expressions for onset, offset and Don’t care F (a, b) = Σ m(2)= m(2) R (a, b) = Σ m(0,3) D = m(1) Id a b g(a,b,c) 0 0 0 0 1 0 1 X 2 1 0 1 3 1 1 0 6

  7. Q: Is F (a, b) = R (a, b) for the given truth table? A. Yes Id a b g(a,b,c) B. No 0 0 0 0 1 0 1 X 2 1 0 1 3 1 1 0 7

  8. Q: Is F (a, b) = R (a, b) for the given truth table? A. Yes Id a b g(a,b,c) B. No because the output 0 0 0 0 contains don’t cares 1 0 1 X 2 1 0 1 3 1 1 0 8

  9. Q: Is F (a, b) = R (a, b) for the given truth table? A. Yes Id a b g(a,b,c) B. No 0 0 0 0 1 0 1 1 2 1 0 1 3 1 1 0 9

  10. Q: Is F (a, b) = R (a, b) for the given truth table? A. Yes Id a b g(a,b,c) B. No 0 0 0 0 1 0 1 1 2 1 0 1 3 1 1 0 10

  11. PI Q: True or False: For a given digital combinational circuit, the value of the output can be one of three states A. True: It can be 0, 1 or don’t care. B. False: It can only be 0 or 1. 11

  12. PI Q: True or False: For a given digital combinational circuit, the value of the output can be one of three states A. True: 0, 1 or don’t care B. False: The don’t care is not a separate state, rather it is used in the truth table to indicate that the output can be either 0 or 1 12

  13. Reducing Incompletely Specified Functions Q: Which of the following assumptions would result in an implementation with the fewest gates? Id a b f (a, b) A. f(0,1) = 1 B. f(0,1) = 0 0 0 0 0 C. Neither A or B 1 0 1 X D. Both A and B 2 1 0 1 3 1 1 0 13

  14. Reducing Incompletely Specified Functions Q: Which of the following assumptions would result in an implementation with the fewest gates? Id a b f (a, b) A. f(1,1) = 1 B. f(1,1) = 0 0 0 0 0 C. Neither A or B 1 0 1 0 D. Both A and B 2 1 0 1 3 1 1 X 14

  15. Reducing Incompletely Specified Functions Don ’ t care set is important because it allows us to minimize the function Id a b f (a, b) 0 0 0 0 1 0 1 0 2 1 0 1 3 1 1 X 15

  16. Implementation Specification è Schematic Diagram Net list, Switching expression Obj min cost è Search in solution space (max performance) Cost: wires, gates è Literals, product terms, sum terms We want to minimize # of terms, and # of literals 16

  17. Implementation: Specification => Logic Diagram Karnaugh Map: A 2-dimensional truth table Flow 1: Flow 2: 1. Specification 1. Specification 2. Truth Table 2. Truth Table 3. Sum of Products or Product of Sums 3. Karnaugh Map (truth table in two canonical form dimensional space) 4. Reduced expression using Boolean 4. Reduce using K’Maps Algebra 5. Reduced expression (SOP or POS) 5. Schematic Diagram of Two Level 6. Schematic Diagram of Two Level Logic Logic 17

  18. Truth Table vs. Karnaugh Map 2-variable function, f(A,B) ID A B f(A,B) A=0 A=1 0 0 0 f(0,0) B=0 f(0,0) f(1,0) 1 0 1 f(0,1) B=1 f(0,1) f(1,1) 2 1 0 f(1,0) 3 1 1 f(1,1) 18

  19. Truth Table An example of 2-variable function, f(A,B) ID A B f(A,B) minterm 0 0 0 0 1 0 1 1 A ’ B 2 1 0 1 AB ’ 3 1 1 1 AB 19

  20. Function can be represented by sum of minterms: f(A,B) = A ’ B+AB ’ +AB This is not optimal however! We want to minimize the number of literals and terms. 20

  21. To minimize the number of literals and terms. We factor out common terms – A ’ B+AB ’ +AB= A ’ B+AB ’ +AB+AB =(A ’ +A)B+A(B’+B)=B+A Hence, we have f(A,B) = A+B 21

  22. How can we guarantee the most reduced expression was reached? • Boolean expressions can be minimized by combining terms • K-maps minimize equations graphically ID A B f(A,B) A=0 A=1 0 0 0 f(0,0) B=0 A’B’ AB’ 1 0 1 f(0,1) B=1 A’B AB 2 1 0 f(1,0) 3 1 1 f(1,1) 22

  23. K-Map: Truth Table in 2 Dimensions A = 0 A = 1 ID A B f(A,B) 0 2 0 1 B = 0 0 0 0 0 1 0 1 1 1 3 1 1 2 1 0 1 B = 1 3 1 1 1 23

  24. K-Map: Truth Table in 2 Dimensions A = 0 A = 1 ID A B f(A,B) AB ’ 0 2 0 1 B = 0 0 0 0 0 1 0 1 1 1 3 1 1 2 1 0 1 B = 1 3 1 1 1 A ’ B AB f(A,B) = A + B 24

  25. Two Variable K-maps Id a b f (a, b) 0 0 0 f (0, 0) 1 0 1 f (0, 1) 2 1 0 f (1, 0) 3 1 1 f (1, 1) # possible 2-variable functions: For 2 variables as inputs, we have 4=2 2 entries. Each entry can be 0 or 1. Thus we have 16=2 4 possible functions. a f(a,b) b 25

  26. Representation of k-Variable Func. • Boolean Expression (0,1,1,0) (0,1,1,1) (1,1,1,0) (1,1,1,1) • Truth Table B (0,0,1,1) • Cube (0,0,1,0) (1,0,1,0) (1,0,1,1) C • K Map (0,1,0,1) (1,1,0,1) D • Binary Decision (0,0,0,0) (0,0,0,1) (1,0,0,0) (1,0,0,1) Diagram A A cube of 4 variables: (A,B,C,D) 26

  27. Q: Which of the following is a valid K’Map representation of the truth table ? A: K’ Map 1 B: K’ Map 2 C: Both K Maps 1 and 2 D: Neither K Map 1 or 2 K Map 1 (A,B) (0,0) (0,1) (1,0) (1,1) ID A B C f(A,B,C) C=0 f(0,0,0) f(0,1,0) f(1,0,0) f(1,1,0) 0 0 0 0 f(0,0,0) 1 0 0 1 f(0,0,1) C=1 f(0,0,1) f(0,1,1) f(1,0,1) f(1,1,1) 2 0 1 0 f(0,1,0) K Map 2 3 0 1 1 f(0,1,1) (A,B) (0,0) (0,1) (1,1) (1,0) 4 1 0 0 f(1,0,0) C=0 f(0,0,0) f(0,1,0) f(1,1,0) f(1,0,0) 5 1 0 1 f(1,0,1) 6 1 1 0 f(1,1,0) C=1 f(0,0,1) f(0,1,1) f(1,1,1) f(1,0,1) 7 1 1 1 f(1,1,1) 27

  28. Q: Which of the following is a valid K’map representation of the truth table ? A: K’ map 1 B: K’ map 2: Although map 1 is a correct mapping of the truth table it is not useful in getting a reduced expression because terms in adjacent cells cannot be combined C: Both K maps 1 and 2 D: Neither K map 1 or 2 K Map 1 (A,B) (0,0) (0,1) (1,0) (1,1) ID A B C f(A,B,C) C=0 f(0,0,0) f(0,1,0) f(1,0,0) f(1,1,0) 0 0 0 0 f(0,0,0) 1 0 0 1 f(0,0,1) C=1 f(0,0,1) f(0,1,1) f(1,0,1) f(1,1,1) 2 0 1 0 f(0,1,0) K Map 2 3 0 1 1 f(0,1,1) (A,B) (0,0) (0,1) (1,1) (1,0) 4 1 0 0 f(1,0,0) C=0 f(0,0,0) f(0,1,0) f(1,1,0) f(1,0,0) 5 1 0 1 f(1,0,1) 6 1 1 0 f(1,1,0) C=1 f(0,0,1) f(0,1,1) f(1,1,1) f(1,0,1) 7 1 1 1 f(1,1,1) 28

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend