Download presentation
Presentation is loading. Please wait.
1
CS 140 Lecture 3 Professor CK Cheng 10/3/02
2
1.Specification 2.Implementation 3.K-maps Part I.
3
Literals x i or x i ’ Product Termx2x1’x0 Sum Termx2 + x1’ + x0 Minterm of n variables: A product of n variables in which every variable appears exactly once. Definitions
4
Implementation Spec Schematic Diagram Net list Obj min cost Switching expression (max performance) Cost: wires, gates Variables, product terms, sum terms We want to minimize # of terms, # of literals
5
Implementation (Optimization) Id a b f (a, b) 0 0 1 0 1 1 a’b 2 1 0 1 ab’ 3 1 1 1 ab Karnaugh map – 2D truth table
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
On the K-map however: b = 0 b = 1 a = 0 a = 1 0 1 2 3 0 1 1 a’b ab’ ab f(a,b) = a + b
8
Another example Id a b f (a, b) 0 0 1 0 1 1 a’b 2 1 0 0 3 1 1 1 ab f(a,b) = a’b + ab = (a’ + a)b = b
9
On the K-map: b = 0 b = 1 a = 0 a = 1 0 1 2 3 0 1 ab’ ab f(a,b) = b
10
Using Minterms Id a b f (a, b) 0 0 0 0 a + b 1 0 1 1 2 1 0 0 a ‘ + b 3 1 1 1 f(a,b) = (a + b)(a’ + b) = b + aa’ = b + 0 = b
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
Three variables K-maps Id a b c f (a,b,c,d) 0 0 0 0 1 1 0 0 1 1 2 0 1 0 1 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
13
Corresponding K-map 0 1 3 2 4 5 7 6 c = 1 a = 1 b = 1 1 1 1 1 0 0 0 0 (0,0) (0,1) (1,0) (1,0) a = 0 Gray code f(a,b,c) = a’
14
Another example 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
15
Corresponding K-map 0 1 3 2 4 5 7 6 c = 1 a = 1 b = 1 0 1 - 1 0 0 1 1 (0,0) (0,1) (1,0) (1,0) a = 0 f(a,b,c) = b + ca’
16
Yet another example Id a b c f (a,b,c,d) 0 0 0 0 1 1 0 0 1 - 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
17
Corresponding K-map 0 1 3 2 4 5 7 6 c = 1 a = 1 b = 1 1 - 0 1 1 0 0 1 (0,0) (0,1) (1,0) (1,0) a = 0 f(a,b,c) = c’
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.