Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 140 Lecture 2 Combinational Logic CK Cheng 4/04/02.

Similar presentations


Presentation on theme: "CS 140 Lecture 2 Combinational Logic CK Cheng 4/04/02."— Presentation transcript:

1 CS 140 Lecture 2 Combinational Logic CK Cheng 4/04/02

2 I. Combinational Logic 1. Specification Keywords: Truth Table Minterm a * b * c Maxterm a + b + c Some Identities: x * 0 = 0x + 0 = x x * 1 = x x + 1 = 1

3 Example Id a b c a’bc a+b’+c 0 0 0 0 01 1 0 0 1 01 2 0 1 0 00 3 0 1 1 11 4 1 0 0 01 5 1 0 1 01 6 1 1 0 01 7 1 1 1 01

4 Incompletely Specified Function Id a b f (a, b) 0 0 0 1 1 0 2 1 0 1 3 1 1 - 1)The input does not happen. 2)The input happens, but the output is ignored. If it is not specified, it gives us flexibility to optimize the logic. Examples: -Decimal number 0… 9 uses 4 bits. (1,1,1,1) does not happen. -If addition overflows, we don’t care about the sum.

5 There are three sets On Set F =  m (1) Off Set R =  m(0,2) Don’t Care Set D =  m(3) Definitions: Literals x i or x i ’ Product Termx2x1’x0 Sum Termx2 + x1’ + x0 Minterm of n variables: A product of n variables which every variable appears exactly once. Maxterm of n variables Obj: minimize (1) number of terms, (2) number of literals.

6 II. Implementation Id a b f (a, b) 0 0 1 0 1 1 2 1 0 1 3 1 1 1 Karnaugh map – 2D table a = 0 a = 1 b = 0 b = 1 0 2 1 3 0 1 1 Determines row Determines column

7 Function can be represented by sum of minterms: f(a,b) = a’b + ab’ + ab We want to minimize the number of literals and terms however. We factor out common terms – ab’ + ab = a(b’+b) = a * 1 = a a + a = a ab + ab = ab f(a,b) = a + b

8 On the K-map however: a = 0 a = 1 b = 0 b = 1 0 2 1 3 0 1 1 a’b ab’ ab

9 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. f(a,b) abab

10 All possible 2 variable functions 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 0 1 a b aaa bbbbbbbbbbbbbbb 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3

11 K-maps and Corresponding functions 0 1 1 0 1 1 0 1 0 f(a,b) = ab’ + ab = a f(a,b) = a’b + ab f(a,b) = a’b + a’b’ = a’ f(a,b) = b’a’ + b’a = b’ a b bbb 0 2 1 3 0 2 1 3 0 2 1 3 0 2 1 3

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

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

14 Another example in reverse direction Id a b c a’c 0 0 0 0 0 1 0 0 1 1 2 0 1 0 0 3 0 1 1 1 4 1 0 0 0 5 1 0 1 0 6 1 1 0 0 7 1 1 1 0 f(a,b,c) = a’c

15 Corresponding K-map 0 2 6 4 1 3 7 5 b c a 0 0 0 0 1 1 0 0 a’c This rectangle correpsonds to the case where a is 0 and c is 1.


Download ppt "CS 140 Lecture 2 Combinational Logic CK Cheng 4/04/02."

Similar presentations


Ads by Google