Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS 140 Lecture 3 Combinational Logic Professor CK Cheng CSE Dept. UC San Diego.

Similar presentations


Presentation on theme: "1 CS 140 Lecture 3 Combinational Logic Professor CK Cheng CSE Dept. UC San Diego."— Presentation transcript:

1 1 CS 140 Lecture 3 Combinational Logic Professor CK Cheng CSE Dept. UC San Diego

2 2 1.Specification 2.Implementation 3.K-maps Part I.

3 3 Literals x i or x i ’ Product Termx 2 x 1 ’x 0 Sum Termx 2 + x 1 ’ + x 0 Minterm of n variables: A product of n variables in which every variable appears exactly once. Definitions

4 4 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, # of literals

5 5 Implementation (Optimization) Karnaugh map – 2D truth table IDABf(A,B)minterm 0000 1011A’B 2101AB’ 3111AB

6 6 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. We factor out common terms – A’B+AB’+AB= A’B+AB’+AB+AB =(A’+A)B+A(B’+B)=B+A f(A,B) = A+B

7 7 On the K-map however: A = 0 A = 1 B = 0 B = 1 0 2 1 3 0 1 1 A’B AB’ AB f(A,B) = A + B

8 8 IDABf(A,B)minterm 0000 1011A’B 2100 3111AB Another Example f(A,B)=A’B+AB=(A’+A)B=B

9 9 On the K-map: A = 0 A= 1 B= 0 B = 1 0 2 1 3 0 1 A’B AB f(A,B)=B

10 10 IDABf(A,B)Maxterm 0000A+B 1011 2100A’+B 3111 Using Maxterms f(A,B)=(A+B)(A’+B)=(AA’)+B=0+B=B

11 11 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) 2 variables means we have 2 2 entries and thus we have 2 to the 2 2 possible functions for 2 bits, which is 16. f(a,b) abab

12 12 Two-Input Logic Gates

13 13 More Two-Input Logic Gates

14 14 Three variables K-maps Id a b c f (a,b,c) 0 0 0 0 1 1 0 0 1 0 2 0 1 0 1 3 0 1 1 0 4 1 0 0 1 5 1 0 1 0 6 1 1 0 1 7 1 1 1 0

15 15 Corresponding K-map 0 2 6 4 1 3 7 5 b = 1 c = 1 a = 1 1 1 1 1 0 0 0 0 (0,0) (0,1) (1,1) (1,0) c = 0 Gray code f(a,b,c) = c’

16 16 Karnaugh Maps (K-Maps) Boolean expressions can be minimized by combining terms K-maps minimize equations graphically PA + PA = P

17 17 Circle 1’s in adjacent squares In the Boolean expression, include only the literals whose true K-map y(A,B)=A’B’

18 18 Another 3-Input example Id a b c f (a,b,c) 0 0 0 0 0 1 0 0 1 0 2 0 1 0 1 3 0 1 1 0 4 1 0 0 1 5 1 0 1 1 6 1 1 0 - 7 1 1 1 1

19 19 Corresponding K-map 0 2 6 4 1 3 7 5 b = 1 c = 1 a = 1 0 1 - 1 0 0 1 1 (0,0) (0,1) (1,1) (1,0) c = 0 f(a,b,c) = a + bc’

20 20 Yet another example Id a b c f (a,b,c,d) 0 0 0 0 1 1 0 0 1 1 2 0 1 0 - 3 0 1 1 0 4 1 0 0 1 5 1 0 1 1 6 1 1 0 0 7 1 1 1 0

21 21 Corresponding K-map 0 2 6 4 1 3 7 5 b = 1 c = 1 a = 1 1 - 0 1 1 0 0 1 (0,0) (0,1) (1,1) (1,0) c = 0 f(a,b,c) = b’

22 22 4-input K-map

23 23 4-input K-map

24 24 4-input K-map

25 25 K-maps with Don’t Cares

26 26 K-maps with Don’t Cares

27 27 K-maps with Don’t Cares


Download ppt "1 CS 140 Lecture 3 Combinational Logic Professor CK Cheng CSE Dept. UC San Diego."

Similar presentations


Ads by Google