l2 Combi Logic
l2 Combi Logic
Acknowledgements: Materials in this lecture are courtesy of the following sources and are used with permission. Prof. Randy Katz (Unified Microelectronics Corporation Distinguished Professor in Electrical Engineering and Computer Science at the University of California, Berkeley) and Prof. Gaetano Borriello (University of Washington Department of Computer Science & Engineering) from Chapter 2 of R. Katz, G. Borriello. Contemporary Logic Design. 2nd ed. Pentice-Hall/Pearson Education, 2005. J. Rabaey, A. Chandrakasan, B. Nikolic. Digital Integrated Circuits: A Design Perspective. Prentice Hall/Pearson, 2003.
OUT 1 0
"0"
N+
P-substrate
N+
VT = 0.5V S
Vs
Switch Model
L2: 6.111 Spring 2006
OFF
RNMOS
VGS < VT
ON
RNMOS
VGS > VT
6
drain
x 10
-4
VGS= 2.5 V
4 (A) 3
D
Resistive
Saturation
VGS= 2.0 V
I 2
gate oxide
D ID G + VGS VT = 0.5V S
L2: 6.111 Spring 2006
0 0
MOS is a very non-linear. Switch-resistor model sufficient for first order analysis.
4
P+
N-substrate
P+
VDD
Switch Model
L2: 6.111 Spring 2006
OFF
RPMOS
VGS > VT
ON
RPMOS
VGS < VT
VDD
S G D
VDD RPMOS
IN OUT OUT
IN
D G S
RNMOS
IN
VDD
G S
PMOS
Vin = 0.5
Vin = 2
NMOS
Vin = 1
D IN G S D OUT
Vin = 1.5
Vin = 1
CMOS gates have: Rail-to-rail swing (0V to VDD) Large noise margins zero static power dissipation
L2: 6.111 Spring 2006
1.5
out
V
1 0.5 0 0 0.5 1 1.5 2 2.5
(V)
V (V)
in
X 0 0 1 1
Y 0 1 0 1 0 0 0 0 0 0 0 1 0 0 1 0
X
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
X=Y
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
1
0 X AND Y
X XOR Y X OR Y
NOT Y NOT X
X NOR Y NOT (X OR Y)
Symbol
Z
Truth-Table
X 0 0 1 1 X Y 0 1 0 1 Y 0 1 0 1 Y 0 1 0 1 Z 1 1 1 0 Z 0 0 0 1 Z 1 0 0 0
Expression
Z=XY
AND
X Y
0 0 1 1 X
Z=XY
NOR
X Y
0 0 1 1
Z=X+Y
Y 0 1 0 1
Z 0 1 1 1 9
OR
X Y
0 0 1 1
Z=X+Y
Y 0 1 0 1
Z 0 1 1 0
(X Y)
XOR
X Y
0 1 1
Y 0 1 0 1
Z 1 0 0 1
XNOR
(X Y)
X Y
0 0 1 1
...
A1 An ...
Note: CMOS gates result in inverting functions! (easier to build NAND vs. AND)
PUN O
A B
PDN
B
CL
A 0 0 1 1
O 1 1 1 0
Elementary
1. X + 0 = X 2. X + 1 = 1 3. X + X = X 4. (X) = X 5. X + X = 1 5D. X X = 0 6D. X Y = Y X 7D. (X Y) Z = X (Y Z) 8D. X + (Y Z) = (X + Y) (X + Z) 9D. (X + Y) (X + Y) = X 10D. X (X + Y) = X 11D. (X Y) + Y = X + Y
12
Commutativity:
6. X + Y = Y + X
Associativity:
7. (X + Y) + Z = X + (Y + Z)
Distributivity:
8. X (Y + Z) = (X Y) + (X Z)
Uniting:
9. X Y + X Y = X
Absorption:
10. X + X Y = X 11. (X + Y) Y = X Y
Factoring:
12. (X Y) + (X Z) = X (Y + Z) 12D. (X + Y) (X + Z) = X + (Y Z) 13D. (X + Y) (Y + Z) (X + Z) = (X + Y) (X + Z) 14D. (X Y ...) = X + Y + ...
Consensus:
13. (X Y) + (Y Z) + (X Z) = XY+XZ
De Morgan's:
14. (X + Y + ...) = X Y ...
Generalized De Morgan's:
15. f(X1,X2,...,Xn,0,1,+,) = f(X1,X2,...,Xn,1,0,,+)
Duality
Dual of a Boolean expression is derived by replacing by +, + by , 0 by 1, and 1 by 0, and leaving variables unchanged f (X1,X2,...,Xn,0,1,+,) f(X1,X2,...,Xn,1,0,,+)
13
A B Cin
S Cout
is true Each variable appears exactly once, in true or inverted form (but not both)
14
S = A B Cin + A B Cin + A B Cin + A B Cin =( A B + A B )Cin + (A B + A B) Cin =(A B) Cin + (A B) Cin = A B Cin
15
Product term (or minterm): ANDed product of literals input combination for which output is true A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 minterms A B C A B C A B C A B C A B C A B C A B C A B C m0 m1 m2 m3 m4 m5 m6 m7 F in canonical form: F(A, B, C) = m(1,3,5,6,7) = m1 + m3 + m5 + m6 + m7 F = A B C + A B C+ A B C + A B C + ABC canonical form minimal form F(A, B, C) = A B C + A B C + AB C + ABC + ABC = (A B + A B + AB + AB)C + ABC = ((A + A)(B + B))C + ABC = C + ABC = ABC + C = AB + C
Sum term (or maxterm) - ORed sum of literals input combination for which output is false A B C maxterms 0 0 0 A + B + C M0 F in canonical form: 0 0 1 A + B + C M1 F(A, B, C) = M(0,2,4) 0 1 0 A + B + C M2 = M0 M2 M4 0 1 1 A + B + C M3 = (A + B + C) (A + B + C) (A + B + C) 1 0 0 A + B + C M4 canonical form minimal form 1 0 1 A + B+ C M5 F(A, B, C) = (A + B + C) (A + B + C) (A + B + C) 1 1 0 A + B +C M6 = (A + B + C) (A + B + C) 1 1 1 A +B + C M7 (A + B + C) (A + B + C) = (A + C) (B + C) short-hand notation for maxterms of 3 variables
Introductory Digital Systems Laboratory 16
Minterm expansion of F to Maxterm expansion of F': rewrite in Maxterm form, using the same indices as F E.g., F(A,B,C) = m(3,4,5,6,7) = M(0,1,2) F'(A,B,C) = M(3,4,5,6,7) = m(0,1,2)
17
two element subsets of the ON-set where only one variable changes its value this single varying variable can be eliminated and a single product term used to represent both elements
F = A B +AB = (A +A)B = B A 0 0 1 1 B 0 1 0 1 F 1 0 1 0 B has the same value in both on-set rows B remains A has a different value in the two rows A is eliminated
18
Boolean Cubes
Just another way to represent truth table Visual technique for identifying when the uniting theorem can be applied n input variables = n-dimensional "cube"
XY
1-cube
0 X
01 Y 00 X
11 2-cube 10
1011 0111 WXYZ 1111 1010 1110
011 010
0110 Y 000 X Z 001 101 100 0000 Y Z W X 0100 1000 0001 0101
3-cube
L2: 6.111 Spring 2006
4-cube
Introductory Digital Systems Laboratory 19
Uniting theorem
A 0 0 1 1 B 0 1 0 1 F 1 0 1 0 F 01 B 00 A 10 11
B 000
C A
101
A(B+B)Cin
The on-set is completely covered by the combination (OR) of the subcubes of lower dimensionality - note that 111 is covered three times
20
on-set forms a square i.e., a cube of dimension 2 (2-D adjacency plane) represents an expression in one variable i.e., 3 dimensions 2 dimensions A is asserted (true) and unchanged B and C vary This subcube represents the literal A
i.e., a single node, yields a term in 3 literals 1-cube, i.e., a line of two nodes, yields a term in 2 literals 2-cube, i.e., a plane of four nodes, yields a term in 1 literal 3-cube, i.e., a cube of eight nodes, yields a constant term "1"
In general,
m-subcube
literals
L2: 6.111 Spring 2006 Introductory Digital Systems Laboratory 21
Karnaugh Maps
Guide to applying the uniting theorem - On-set elements with only one variable changing value are adjacent unlike in a linear truth-table
B A 0 1
0 1
0 1 0
2 3
1 1 0
A 0 0 1 1
B 0 1 0 1
F 1 0 1 0
e.g., 00, 01, 11, 10 (only a single bit changes in code for adjacent map cells)
A B 0 0 0 1 1 2 3 01 AB C 00 0 0 1 1 2 3 B 6 7 4 5 01 11 A 10 C 10 11 1 3 2 5 7 6 B 13 15 14 9 11 10 D 1 AB CD 00 A 00 0 01 4 11 12 10 8
2-variable K-map
3-variable K-map
4-variable K-map
22
K-Map Examples
AB Cin 0 1 00 0 0 01 0 1 11 1 1 A 10 0 1
AB C 0 1 00 0 0 01 0 0 B 11 1 1 A 10 1 1
Cout =
AB C 0 1 A 00 1 0 01 0 0 B 11 0 1 10 1 1
F(A,B,C) =
AB C 0 1 A 00 0 1 01 1 1 B 11 1 0 10 0 0
F(A,B,C) = m(0,4,5,7) F=
F' simply replace 1's with 0's and vice versa F'(A,B,C) = m(1,2,3,6) F' =
23
AB CD 00 01 11 C 10
A 00 1 0 1 1 01 0 1 1 1 B 11 0 0 1 1 10 1 0 D 1 1
F(A,B,C,D) = m(0,2,3,5,6,7,8,10,11,14,15) F=C + A BD + B D Find the smallest number of the largest possible subcubes that cover the ON-set
1011 0111 0011 0010 1010 1110 0110 1001 C D 0000 0001 A B 0100 0101 1100 1000
1111
24
F(A,B,C,D) = m(1,3,5,7,9) + d(6,12,13) F = A D + B C D w/o don't cares F = C D + A D w/ don't cares By treating this DC as a "1", a 2-cube can be formed rather than one 0-cube
AB CD 00 01 A 00 0 1 1 0 01 0 1 1 X B 11 X X 0 0 10 0 1 D 11 0 0 C 10
25
Hazards
00 01 11 10 0 0 0 1 1 1 1 0
Gate delay
Figure by MIT OpenCourseWare. L2: 6.111 Spring 2006 Introductory Digital Systems Laboratory 26
Fixing Hazards
The glitch is the result of timing differences in parallel data paths. It is associated with the function jumping between groupings or product terms on the K-map. To fix it, cover it up with another grouping or product term!
A C B
AB C 00 01 11 10 0 0
F
0 1
1 1
1 0
1 0
F=A*C+B*C+A*B
In general, it is difficult to avoid hazards need a robust design methodology to deal with hazards.
L2: 6.111 Spring 2006 Introductory Digital Systems Laboratory 27