Download Function Optimization - Design Automation of Embedded Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!
Function Optimization
- Switching Function Representations can be Classified in Terms
of Levels
- Number of Levels, k, is Number of Unique Boolean (binary)
Operators
EXAMPLES
f 1 (^) = x 1 (^) + x 2 (^) + x 3
f (^) 2 = abcd
f 3 = ab + cd + afe
f (^) 4 = ( a + b + c )( b + c + d )
f (^) 5 = ab ⊕ cd ⊕ abc
f (^) 6 = [( ab + c )( cd + e )] ⊕ ( ab + ce ) dc
1-Level
2-Level
multi-level
k -Level functions
n
Possible Switching Functions of n Variables (actually much fewer types
obtained by permuting and/or complementing input variables)
- 1-Level Forms
- Cannot Represent all Possible Functions
- 2-Level Forms
- Can Represent all Possible Functions
- With Additional Restrictions – CANONICAL
- k -Level Forms ( k ≥ 2 )
- Many Different Ways to Represent a Given Functions
- If a multi-input Gate Represents a (binary or greater) Boolean Operator
- Expression can Represent a Netlist
- k Indicates “depth” of Netlist
EXAMPLES
1-Level
2-Level (^) Multi-Level
f = a + b + c
f = ( a + b )( b + c )( a + c + d )
a
c
b
c
a c
b
b^ c
a b
e
d
a
f
b f
f
f = ( a + b )( c ⊕ d e )
Common Terms for 2-Level Minimization
- Literal – A variable in complemented or uncomplemented form
- Product – The disjunction (AND) of a set of literals; also represents a
cube
- Support Set – Set of all variables that define the domain of a switching
function
- Minterm – A disjunction (AND) containing an instance of each literal
corresponding to a variable in the support set that is in the on-set, f on ,of
a function
- Don’t Care – The absence of a supporting variable in a product term
- Implicant – A product term that covers one or more minterms in the on-
set, f on , of a function
- Prime Implicant – An implicant in the on-set, f on , of a function such that it
is not a subproduct of any other possible implicant in the set.
- Essential Prime Implicant – A prime implicant that covers at least one
minterm NOT covered by any other implicant in the on-set, f on.
SOP Minimization – Terms Example
Consider: (^) { , , , , , }
on f = b d abc bd acd abc bcd
- Each Element of f on^ is an Implicant
- Prime Implicants are:
{ b d abc bd acd abc , , , , }
- abc is a Prime Implicant but NOT an
Essential Prime Implicant
- bcd is an Implicant but NOT a
Prime Implicant
- bd is an Essential Prime Implicant
- Product abc :
- covers minterms: m 4 = abcd and m 5 = abcd
- disjunction of literals a , b , c
- variable d is a Don’t Care
- f Represented by f on^ has Support Set: { a, b, c, d }
Tabulation
Method
Tabulation Method - Notation
- Consider Support Set of f : S= { x1 , x 2 , …, x (^) n }
- x (^) i
ci denotes:
x (^) i if c (^) i = ‘1’
x (^) i if c (^) i = ‘0’
1 if c (^) i = ‘-’
- If NO c (^) i = -, then we have a minterm
- Can be Represented by Decimal Equivalent of c (^) i
EXAMPLE ( S= { x 1 , x 2 , x 3 , x 4 })
x
1 x^
2 x
3 x
4 =^ m9 , a minterm^ →^ c 1 c 2 c 3 c 4 = 1001 = 9
x
1 x^
2 x
3 x
4 = a 4-cube^ →^ 0--
Tabulation Method
Input: f
on as a set of minterms
Output: f
on as a set of
1. All Essential Prime Implicants
2. As Few Prime Implicants as Possible
Finding as few Prime Implicants as Possible
is an NP-Hard Problem!!!!!
- Reduces to the “Set Covering” Problem for Unate Functions
Unate function – a constant or is represented by a SOP using
either uncomplemented or complemented literals for each
variable
- Reduces to the “Minimum Cost Assignment” Problem for Binate
Functions (ex. EXOR)
This is 2-Level (SOP) Optimization (Minimization)
Tabulation Method
- STEP 1:
- Convert Minterm List (specifying f on ) to Prime Implicant List
- STEP 2:
- Choose All Essential Prime Implicants
- If all minterms are covered
HALT
Else
GO To STEP 3
- STEP 3:
- Formulate the Reduced Cover Table Omitting the rows/cols of EPI
- If Cover Table can be Reduced using Dominance Properties, Go To Step 2
- Else Must Solve the “Cyclic Cover” Problem
1) Use Exact Method (exponentially complex)
2) Use Heuristic Method (possibly non-optimal result)
NOTE: “Quine-McCluskey” Refers to Using a “Branch and Bound” Heuristic
NOTE: “Petrick’s Method” is Exact Technique – Generates all Solutions
Allowing the Best to be Used
STEP 1 - EXAMPLE
f on^ = { m 0 , m 1 , m 2 , m 3 , m 5 , m 8 , m 10 , m 11 , m 13 , m 15 } = ∑ (0, 1, 2, 3, 5, 8, 10, 11, 13,
Minterm Cube 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 8 1 0 0 0 3 0 0 1 1 5 0 1 0 1 10 1 0 1 0 11 1 0 1 1 13 1 1 0 1 15 1 1 1 1
STEP 1 - EXAMPLE
f on^ = { m 0 , m 1 , m 2 , m 3 , m 5 , m 8 , m 10 , m 11 , m 13 , m 15 } = ∑ (0, 1, 2, 3, 5, 8, 10, 11, 13,
Minterm Cube 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 8 1 0 0 0 3 0 0 1 1 5 0 1 0 1 10 1 0 1 0 11 1 0 1 1 13 1 1 0 1 15 1 1 1 1
Minterm Cube 0,1 0 0 0 - 0,2 0 0 - 0 0,8 - 0 0 0
1,3 0 0 - 1 1,5 0 - 0 1 2,3 0 0 1 - 2,10 - 0 1 0 8,10 1 0 - 0 3,11 - 0 1 1 5,13 - 1 0 1 10,11 1 0 1 -
11,15 1 - 1 1 13,15 1 1 - 1
STEP 1 - EXAMPLE
f on^ = { m 0 , m 1 , m 2 , m 3 , m 5 , m 8 , m 10 , m 11 , m 13 , m 15 } = ∑ (0, 1, 2, 3, 5, 8, 10, 11, 13,
Minterm Cube 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 8 1 0 0 0 3 0 0 1 1 5 0 1 0 1 10 1 0 1 0 11 1 0 1 1 13 1 1 0 1 15 1 1 1 1
Minterm Cube 0,1 0 0 0 - 0,2 0 0 - 0 0,8 - 0 0 0
1,3 0 0 - 1 1,5 0 - 0 1 PI=D 2,3 0 0 1 - 2,10 - 0 1 0 8,10 1 0 - 0 3,11 - 0 1 1 5,13 - 1 0 1 PI=E 10,11 1 0 1 -
11,15 1 - 1 1 PI=F 13,15 1 1 - 1 PI=G
Minterm Cube
0,1,2,3 0 0 - - PI=A 0,8,2,10 - 0 - 0 PI=C 2,3,10,11 - 0 1 - PI=B
f on^ = { A,B,C,D,E,F,G } = {00--, -01-, -0-0, 0-01, -101, 1-11, 11-1}
Question: Can
this be done on
a CCM? How
modified?
STEP 2 – Construct Cover Table
- PIs Along Vertical Axis (in order of # of literals)
- Minterms Along Horizontal Axis
0 1 2 3 5 8 10 11 13 15
A x x x x
B x x x x
C x x x x
D x x
E x x
F x x
G x x
NOTE: Table 4.2 in book is incomplete
STEP 2 – Reduced Table
0 1 2 3 5 8 10 11 13 15
A x x x x
B x x x x
C x x x x
D x x
E x x
F x x
G x x
A x x
B x x
D x x
E x x
F x x
G x x
Essential row
Distinguished Column
Essential row
- The Column of the Single x in
the Essential Row is a
Distinguished Column
Row and Column Dominance
- If Row P has x’s Everywhere Row Q Does
Then Q Dominates P if P has fewer x’s
- If Column i has x’s Everywhere j Does
Then j Dominates i if i has fewer x’s
- If Row P is equal to Row Q and Row Q does not cost more than Row P,
eliminate Row P, or if Row P is dominated by Row Q and Row Q Does
not cost more than Row P, eliminate Row P
- If Column i is equal to Column j , eliminate Column i or if Column i
dominates Column j , eliminate Column i