CS 140 Lecture 2 Combinational Logic CK Cheng 4/04/02
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
Example Id a b c a’bc a+b’+c
Incompletely Specified Function Id a b f (a, b) )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.
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.
II. Implementation Id a b f (a, b) Karnaugh map – 2D table a = 0 a = 1 b = 0 b = Determines row Determines column
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
On the K-map however: a = 0 a = 1 b = 0 b = a’b ab’ ab
Two variable K-maps Id a b f (a, b) f (0, 0) f (0, 1) f (1, 0) 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
All possible 2 variable functions a b aaa bbbbbbbbbbbbbbb
K-maps and Corresponding functions 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
Three variables K-maps Id a b c f (a,b,c,d)
Corresponding K-map b = 1 c = 1 a = (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
Another example in reverse direction Id a b c a’c f(a,b,c) = a’c
Corresponding K-map b c a a’c This rectangle correpsonds to the case where a is 0 and c is 1.