Title: CS 140 Lecture 2 Combinational Logic
1CS 140 Lecture 2 Combinational Logic
2I. Combinational Logic1. Specification
Keywords Truth Table Minterm a b
c Maxterm a b c Some Identities x 0
0 x 0 x x 1 x x 1 1
3Example
Id a b c abc abc 0
0 0 0 0 1 1 0 0
1 0 1 2 0 1 0
0 0 3 0 1 1 1 1 4 1
0 0 0 1 5 1 0 1
0 1 6 1 1 0 0 1 7
1 1 1 0 1
4Incompletely Specified Function
Id a b f (a, b) 0 0 0
1 1 0 1 0
2 1 0 1 3 1
1 -
- The input does not happen.
- 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 dont care about the
sum.
5There are three sets
On Set F Sm (1) Off Set
R Sm(0,2) Dont Care Set D
Sm(3)
Definitions Literals xi or xi Product
Term x2x1x0 Sum Term x2 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.
6II. Implementation
Karnaugh map 2D table
Id a b f (a, b) 0 0 0
0 1 0 1 1
2 1 0 1 3 1
1 1
Determines row
a 0 a 1
0 2
0 1 1 1
b 0 b 1
1 3
Determines column
7Function can be represented by sum of
minterms f(a,b) ab ab ab We want to
minimize the number of literals and terms
however. We factor out common terms ab ab
a(bb) a 1 a a a a ab ab
ab f(a,b) a b
8On the K-map however
a 0 a 1
ab
0 2
0 1 1 1
b 0 b 1
1 3
ab
ab
9Two 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 22 entries and thus we
have 2 to the 22 possible functions for 2 bits.
a b
f(a,b)
10All possible 2 variable functions
a
a
a
a
1 0 0 0
0 0 1 0
0 0 0 1
0 0 0 0
1 1 0 0
1 0 1 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 1 1 0
0 1 0 1
1 1 1 1
1 1 0 1
0 1 1 1
1 0 1 1
11K-maps and Corresponding functions
a
0 1 0 1
f(a,b) ab ab a
b
1 0 1 1
f(a,b) ab ab
1 0 1 0
f(a,b) ab ab a
1 1 0 0
f(a,b) ba ba b
12Three 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
13Corresponding K-map
b 1
(a,b)
Gray code
(0,0) (0,1) (1,0) (1,0)
0 2 6
4
c 0
0 1 1 0
1 3 7
5
c 1
1 - 1 0
a 1
f(a,b,c) abc abc abc abc abc
abc b ac b
14Another example in reverse direction
f(a,b,c) ac
Id a b c ac 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
15Corresponding K-map
b
0 2 6
4
0 0 0 0
1 3 7
5
c
1 1 0 0
a
ac
This rectangle correpsonds to the case where a is
0 and c is 1.