weikang qian. outline intersection pattern and the problem motivation solution 2
TRANSCRIPT
Weikang Qian
OutlineIntersection Pattern and the ProblemMotivationSolution
2
Intersection Pattern of CubesSum-of-product Boolean function: A set of
cubesExample:
Notation V( f ): number of minterms covered by f
Intersection pattern: numbers of minterms covered by the intersections of all subsets of cubes
3
Example of Intersection Pattern
4
3 cubes on 4 variables
Intersection pattern depends on the total number of variables!
Reverse ProblemGiven the number of variables and an
intersection pattern, synthesize cubes to satisfy that pattern
5
Example: Synthesize 3 cubes on 4 variables so that
Sol.: One solution is
Reverse problem (cont.)Sometimes, these is no solution!
6
Example: Synthesize 2 cubes on 4 variables so that
Sol.: No solution! Why?
00 01 11 10
00
01
11
10
x0x1
x2x3
1 1
1 1
1 1
1 1
c0
No way to put the rectangle of 4 ones so the intersection has 1 minterms!
OutlineIntersection Pattern and the ProblemMotivationSolution
7
Why Intersection Pattern?Probabilistic computation
Digital circuit operating on random bit streamsTransform probabilities into probabilities
ApplicationIn test: Weighted random pattern generationHardware implementation of probabilistic
algorithms8
AND
xy z
P(x = 1) = 0.4
P(z = 1) = 0.2P(y = 1) = 0.5
0,1,0,1,0,0,1,1,0,0
1,0,1,1,0,0,1,0,0,1
0,0,0,1,0,0,1,0,0,0
A Fundamental Synthesis Problem
9
Independent Combinational
Logic
0.5
0.5
0.5
0.5
q
?
Output Probability: AnalysisIf the number of inputs is n, then q = m/2n
Each input combination has probability 1/2n
If the Boolean function has m minterms, then q = m/2n
10
5 mintermsq = 5/8
Output Probability: SynthesisImplement m/2n
Choose m mintermsBut, which m minterms to choose?
11
Example: q = 7/16
00 01 11 10
00
01
11
10
x0x1
x2x3
1 1
1 1
1 1 1
00 01 11 10
00
01
11
10
x0x1
x2x3
1 1
1 1 1
1 1
Two Level Logic Synthesis ProblemGiven number of inputs n and m, find a SOP
Boolean function with minimum cubes to cover m minterms.
12
Optimization Flow
λ = Lower bound on the number of cubes to cover m
minterms
Exist λ cubes to cover m interms?
endY
λ = λ + 1
N Related
Exist λ cubes to cover m miterms?Step 1: Construct an intersection pattern so
that it covers m minterms by Inclusion-Exclusion Principle:
Step 2: Synthesize cubes to satisfy the intersection pattern (Focus of this work)
13
OutlineIntersection Pattern and the ProblemMotivationSolution
14
PreliminariesLiterals: If cube c has k literals, then V(c) = 2n − k
Empty cube: c = 0, V(c) = 0For a cube c,
15
Cube-Variable Matrix Dλ rows, each corresponding to a cuben columns, each corresponding to a variable
16
Example:
If a row vector has k *’s, V(c) = 2k
Synthesis a cube-variable matrix to satisfy theintersection pattern
V(c) = 2
PropertiesNegation
Column negation and column permutation of matrix maintain the intersection pattern.
17
exchangecolumn 1 & 2
negatecolumn 1
Same pattern:
Key Ideas of SolutionDetermine what each column should beEach column has 3λ candidate choices:
Only need to consider a subset of candidate choicesFor example, by column negation invariability,
choice equivalent to choice Column permutation invariability: position does
not matter; only number of occurrence of each candidate choice in cube-variable matrix matters
18
A Special CaseA case where all-cube intersection is non-
emptyCandidate choices: those columns that do not
contain both a 0 and a 1
Further reduction on candidate choices: only consider columns without 0’s
19
XIntersection Empty!}
By column negationinvariability:
Replaced by
Special Case: Illustration with λ = 3Candidate choices:
Number of occurrences in cube-variable matrix matters
Set equations between unknowns and knowns
20
y0 y1 y2 y3 y4 y5 y6 y7unknowns:
knowns: n, V(c0), V(c1), V(c0c1), V(c2), V(c0c2), V(c1c2), V(c0c1c2)
c0
c1
c2
Set up Equations
21
knowns: n, V(c0), V(c1), V(c0c1), V(c2), V(c0c2), V(c1c2), V(c0c1c2)
y0 y1 y2 y3 y4 y5 y6 y7unknowns:
c0
c1
c2
Equation on n
Equation on V(c0)• If a row vector of c has k *’s, V(c) = 2k
• Relates to total number of columns with first entry *
y0 + y1 + y2 + y3 + y4 + y5 + y6 + y7 = n
Each column belongs to one of the candidate choices
y1 + y3 + y5 + y7 = k1 = log2V(c0)
y2 + y3 + y6 + y7 = log2V(c1)Equation on V(c1)
y4 + y5 + y6 + y7 = log2V(c2)Equation on V(c2)
Set up Equations (cont.)
22
knowns: n, V(c0), V(c1), V(c0c1), V(c2), V(c0c2), V(c1c2), V(c0c1c2)
y0 y1 y2 y3 y4 y5 y6 y7unknowns:
c0
c1
c2
Equation on V(c0c1)
• If a row vector of c has k *’s, V(c) = 2k
• Relates to total number of columns with 1st and 2nd entry both *
c0
c1
c2
c0c1
contribute to * in c0c1
y3 + y7 = k3 = log2V(c0c1)
Equation on V(c0c2)
y5 + y7 = log2V(c0c2)
Equation on V(c1c2)
y6 + y7 = log2V(c1c2)
Set up Equations (cont.)
23
knowns: n, V(c0), V(c1), V(c0c1), V(c2), V(c0c2), V(c1c2), V(c0c1c2)
y0 y1 y2 y3 y4 y5 y6 y7unknowns:
c0
c1
c2
Equation on V(c0c1c2)• Relates to total number of columns with 1st, 2nd, and 3rd entry all *
y7 = log2V(c0c1c2)
System of Linear Equations
24
y0 + y1 + y2 + y3 + y4 + y5 + y6 + y7 = n = k0
y1 + y3 + y5 + y7 = log2V(c0) = k1
y2 + y3 + y6 + y7 = log2V(c1) = k2
y4 + y5 + y6 + y7 = log2V(c2) = k4
y3 + y7 = log2V(c0c1) = k3
y5 + y7 = log2V(c0c2) = k5
y6 + y7 = log2V(c1c2) = k6
y7 = log2V(c0c1c2) = k7
Matrix form
Solution
Solution of the Special CaseSolutionIf all entries of are non-negative, then we
find one set of cubes satisfying the intersection pattern
Otherwise, there is no set of cubes satisfying the intersection pattern
25
Example of Special Case
26
Synthesize 3 cubes on 5 variables so that V(c0) = V(c1) = 16, V(c0c1) = V(c2) = 8, V(c0c2) = V(c1c2) = 4, V(c0c1c2) = 2
Sol.:
y0 y1 y2 y3 y4 y5 y6 y7
Cube-variable matrix
General CasesCases where all-cube intersection could be
emptySame ideas
Reduce candidate choicesTake numbers of occurrences as unknowns Set up equations between unknowns and
knownsA system of linear equalities and inequalities
27
ConclusionProblem: Synthesize a set of cubes to satisfy
a given intersection patternImportant step in the two-level logic
synthesis for probabilistic computationSolution: Determine the number of
occurrences of each candidate choiceFuture work: integrate into the optimization
problem
28
Thank You!
29