1 State Assignment The problem: Assign a unique code to each state to produce a minimal binary logic...
-
Upload
gladys-mccarthy -
Category
Documents
-
view
214 -
download
0
Transcript of 1 State Assignment The problem: Assign a unique code to each state to produce a minimal binary logic...
1
State AssignmentState AssignmentThe problem:The problem:Assign a Assign a uniqueunique code to each state to produce a minimal binary logic level code to each state to produce a minimal binary logic level
implementation. implementation.
Given:Given: 1.1. |S| states, |S| states,
2.2. at least at least log |S|log |S| state bits ( state bits (minimum width encodingminimum width encoding), ),
3.3. at most |S| state bits (at most |S| state bits (one-hot encodingone-hot encoding))
estimate impact of encoding on the estimate impact of encoding on the sizesize and and delaydelay of the optimized implementation. of the optimized implementation.
Most known techniques are directed towards reducing the size. Difficult to estimate Most known techniques are directed towards reducing the size. Difficult to estimate delay before optimization.delay before optimization.
There are possible state assignments for 2There are possible state assignments for 2nn codes (n codes (n log |S| log |S| ), ),
since there are that many ways to select |S| distinct state codes and |S|! ways to since there are that many ways to select |S| distinct state codes and |S|! ways to permute them among the states.permute them among the states.
2!
n
SS
2
State AssignmentState AssignmentTechniques are in two categories:Techniques are in two categories:Heuristic Heuristic techniquestechniques try to capture some aspect of the process of optimizing try to capture some aspect of the process of optimizing
the logic, e.g. common cube extraction.the logic, e.g. common cube extraction.
Example:Example:
1.1. Construct a weighted graph of the states. Weights express the gain in Construct a weighted graph of the states. Weights express the gain in keeping the codes of the pair of states ‘close’.keeping the codes of the pair of states ‘close’.
2.2. Assign codes that minimize a proximity function Assign codes that minimize a proximity function (graph embedding step)(graph embedding step)
Exact Exact techniquestechniques model precisely the process of optimizing the resulting logic model precisely the process of optimizing the resulting logic as an as an encoding problemencoding problem. .
Example:Example:
1.1. Perform an appropriate multi-valued logic Perform an appropriate multi-valued logic minimizationminimization (optimization (optimization step)step)
2.2. Extract a set of encoding Extract a set of encoding constraintsconstraints, that put conditions on the codes, that put conditions on the codes
3.3. Assign codes that Assign codes that satisfysatisfy the encoding constraints the encoding constraints
3
SA as an Encoding SA as an Encoding ProblemProblem
State assignment is a difficult problem:State assignment is a difficult problem: transform transform ‘optimally’‘optimally’ • a cover of a cover of multi-valuedmulti-valued (symbolic) logic functions into (symbolic) logic functions into • an equivalent cover of an equivalent cover of two-valuedtwo-valued logic functions. logic functions.
Various Various applicationsapplications dictate various definitions of optimality. dictate various definitions of optimality.
Encoding problems are classified as Encoding problems are classified as
1.1. input input (symbolic variables appear as input)(symbolic variables appear as input)
2.2. outputoutput (symbolic variables appear as output)(symbolic variables appear as output)
3.3. input-outputinput-output (symbolic variables appear as both input and (symbolic variables appear as both input and output)output)
State assignmentState assignment is the most difficult is the most difficult casecase of of input-outputinput-output encoding encoding where the state variable is both an input and output.where the state variable is both an input and output.
4
Encoding Problems: statusEncoding Problems: statusInputInput Encoding Encoding
OutputOutput Encoding Encoding
Input- OutputInput- Output Encoding Encoding
two-leveltwo-level•well understood theorywell understood theory•efficient algorithmsefficient algorithms•many applicationsmany applications
two-leveltwo-level•well understood theorywell understood theory•nono efficient algorithm efficient algorithm•fewfew applications applications
two-leveltwo-level•well understood theorywell understood theory•nono efficient algorithm efficient algorithm•fewfew applications applications
multi-levelmulti-level•basic theory developedbasic theory developed•algorithms algorithms notnot yet yet maturemature•fewfew applications applications
multi-levelmulti-level•nono theory theory•heuristic algorithmsheuristic algorithms•fewfew applications applications
multi-levelmulti-level•nono theory theory•heuristic algorithmsheuristic algorithms•fewfew applications applications
5
Input Encoding for Two-Input Encoding for Two-Level ImplementationsLevel Implementations
Reference:Reference: [De Micheli, Brayton, Sangiovanni 1985][De Micheli, Brayton, Sangiovanni 1985]
To solve the input encoding problem for To solve the input encoding problem for minimum minimum product termproduct term count: count:
1.1. represent the function as a represent the function as a multi-valuedmulti-valued function function
2.2. apply multi-valued apply multi-valued minimization minimization (Espresso-MV)(Espresso-MV)
3.3. extract,extract, from the minimized multi-valued cover, input from the minimized multi-valued cover, input encoding constraintsencoding constraints
4.4. obtain codesobtain codes (of minimum length) that satisfy all input (of minimum length) that satisfy all input encoding constraintsencoding constraints
6
Input EncodingInput EncodingExampleExample: single primary output of an FSM: single primary output of an FSM3 inputs: state variable, 3 inputs: state variable, ss, and two binary variables,, and two binary variables, cc11 and and cc22
4 states: 4 states: ss00,, ss11, s, s22, s, s33
1 output: 1 output: yy
yy is 1 when following conditions hold: is 1 when following conditions hold:
(state = s(state = s0 0 )) and and cc2 2 = 1= 1
(state = s(state = s0 0 ) ) oror (state = s (state = s2 2 ) ) and and cc1 1 = 0= 0
(state = s(state = s1 1 )) and and cc2 2 = 0 = 0 and and cc1 1 = 1= 1
(state = s(state = s3 3 ) ) oror (state = s (state = s2 2 ) ) and and cc1 1 = 1= 1
PictoriallyPictorially
for outputfor output
Y=1:Y=1:
Values along the state axis are not ordered.
7
Input EncodingInput Encoding
Function representationFunction representation• Symbolic variables represented by multiple valued Symbolic variables represented by multiple valued (MV)(MV) variables variables XXii
restricted to restricted to PPii = { 0,1,…,n = { 0,1,…,nii-1 }.-1 }.
• Output is a binary valued function Output is a binary valued function ff of variables of variables XXii
f : Pf : P11 P P22 … … P Pnn BB
• S S P Pii and and literalliteral X X SS is as: is as:
XXii S S = = {1 if{1 if X XiiSSii {0 otherwise{0 otherwise
Example: y = X Example: y = X {0}{0}cc22+ X + X {0,2}{0,2}cc11’+ X ’+ X {1}{1}cc11cc22’’ + X + X {2,3}{2,3}cc1 1 (only 1 MV variable)(only 1 MV variable)
The cover of the function can also be written in The cover of the function can also be written in positionalpositional form: form:-1 1000 1-1 1000 1
0- 1010 10- 1010 1
10 0100 110 0100 1
1- 0011 11- 0011 1
8
Input EncodingInput Encoding
y = X y = X {0}{0}cc22+ X + X {0,2}{0,2}cc11’+ X ’+ X {1}{1}cc11cc22’’ + X + X {2,3}{2,3}cc11
Minimize using classical two-level MV-minimization (Espresso-MV).Minimize using classical two-level MV-minimization (Espresso-MV).
Minimized result:Minimized result:
y = X y = X {0,2,3} {0,2,3} cc11 cc22+ X + X {0,2}{0,2}cc11’+ X ’+ X {1,2,3}{1,2,3}cc11cc22’’
9
Input EncodingInput Encoding
Extraction of face constraints:Extraction of face constraints:y = X y = X {0,2,3} {0,2,3} cc11
cc22+ X + X {0,2}{0,2}cc11’+ X ’+ X {1,2,3}{1,2,3}cc11cc22’’
The The face constraintsface constraints are: (assign codes to keep MV-literals in single cubes) are: (assign codes to keep MV-literals in single cubes)
((ss00,, ss22, s, s33))
((ss00,, ss22))
((ss11, s, s22, s, s33))
• two-level minimization results in the two-level minimization results in the fewestfewest product terms product terms for any for any possible encodingpossible encoding
• would like to select an encoding that results in the would like to select an encoding that results in the samesame number of number of product termsproduct terms
• each MV literal should be each MV literal should be embeddedembedded in a face (subspace or cube) in the in a face (subspace or cube) in the encoded space of the associated MV-variable.encoded space of the associated MV-variable.
• unused codes may be used as unused codes may be used as don’t caresdon’t cares
10
Input EncodingInput EncodingSatisfaction of face constraints:Satisfaction of face constraints:• lower bound can lower bound can alwaysalways be achieved ( be achieved (one-hot encoding will do itone-hot encoding will do it), ),
– butbut this results in many bits this results in many bits (large code width)(large code width)• for a fixed code width need to find embedding that will result in the fewest cubesfor a fixed code width need to find embedding that will result in the fewest cubes
Example:Example: A satisfying solution is: A satisfying solution is:
ss0 0 = 001, s= 001, s1 1 = 111, s= 111, s2 2 = 101, s= 101, s3 3 = 100= 100
The face constraints are assigned to the following faces:The face constraints are assigned to the following faces:
((ss00,, ss22, s, s33)) 202202
((ss00,, ss22)) 201201
((ss11, s, s22, s, s33)) 122122
Encoded representation:Encoded representation:
y = X y = X {0,2,3} {0,2,3} cc11 cc22+ X + X {0,2}{0,2}cc11’+ X ’+ X {1,2,3}{1,2,3}cc11cc22’’
-> x-> x22’’ cc11 cc22+ x+ x22’’ xx33
cc11’+ x’+ x11 cc11cc22’’
NoteNote: needed 3 bits instead of the minimum 2.: needed 3 bits instead of the minimum 2.
0022
33
11
dcdcdcdc
xx33
xx22
xx11
dcdc
dcdc
11
Procedure for Input Procedure for Input EncodingEncoding
Summary:Summary:A face constraint is satisfied by an encoding if the supercube of the A face constraint is satisfied by an encoding if the supercube of the
codes of the symbolic values codes of the symbolic values inin the literal the literal does not containdoes not contain any any code of a symbolic value code of a symbolic value notnot in the literal. in the literal.
Satisfying Satisfying allall the face constraints guarantees that the encoded the face constraints guarantees that the encoded minimized binary-valued cover will have size minimized binary-valued cover will have size no greaterno greater than than the multi-valued cover.the multi-valued cover.
Once an encoding Once an encoding satisfying all face constraintssatisfying all face constraints has been found, a has been found, a binary-valued encoded cover can be constructed binary-valued encoded cover can be constructed directlydirectly from from the multi-valued cover, by the multi-valued cover, by
• replacing each replacing each multi-valued literalmulti-valued literal by the by the supercubesupercube corresponding to that literal.corresponding to that literal.
12
Satisfaction of Input Satisfaction of Input ConstraintsConstraints
AnyAny set of face constraints can be satisfied by set of face constraints can be satisfied by one-hotone-hot encoding the symbols. But code length is too long …encoding the symbols. But code length is too long …
Finding a Finding a minimumminimum length code that satisfies a given set length code that satisfies a given set of constraints is of constraints is NP-hardNP-hard
[Saldanha, Villa, Brayton, Sangiovanni 1991].[Saldanha, Villa, Brayton, Sangiovanni 1991].
Many approaches proposed. The above reference Many approaches proposed. The above reference describes the describes the bestbest algorithm currently known, based on algorithm currently known, based on the concept of the concept of encoding dichotomies.encoding dichotomies.
[Tracey 1965, Ciesielski 1989][Tracey 1965, Ciesielski 1989]..
13
Satisfying Input Satisfying Input ConstraintsConstraints
Ordered Dichotomy:Ordered Dichotomy:• A A orderedordered dichotomydichotomy is a 2-block partition of a subset of is a 2-block partition of a subset of
symbols. symbols. Example:Example: (s0 s1;s2 s3)(s0 s1;s2 s3)– Left block is Left block is s0,s1s0,s1 - - associated with 0 bitassociated with 0 bit– Right block is Right block is s2 s3s2 s3 - - associated with 1 bitassociated with 1 bit
• A dichotomy is A dichotomy is completecomplete if each symbol of the entire if each symbol of the entire symbol set appears in one blocksymbol set appears in one block– (s0;s1 s2)(s0;s1 s2) is not complete but is not complete but (s0 s1;s2 s3)(s0 s1;s2 s3) is complete is complete
• Two dichotomies Two dichotomies d1d1 and and d2d2 are are compatiblecompatible if if
1.1. the left block of the left block of d1d1 is disjoint from the right block of is disjoint from the right block of d2, d2, andand
2.2. the right block of the right block of d1d1 is disjoint from the left block of is disjoint from the left block of d2.d2.
14
Satisfying Input Satisfying Input ConstraintsConstraints
• The The unionunion of two compatible dichotomies, of two compatible dichotomies, d1d1 and and d2,d2, is is (a;b)(a;b) where where
1.1. aa is the union of the left blocks of is the union of the left blocks of d1d1 and and d2d2 andand
2.2. bb is the union of the right blocks of is the union of the right blocks of d1d1 and and d2. d2. • The set of all The set of all compatiblescompatibles of a set of dichotomies is of a set of dichotomies is
obtained byobtained by– a initial dichotomy is a compatiblea initial dichotomy is a compatible– the union of two compatibles is a compatiblethe union of two compatibles is a compatible
ExampleExample: initial (0 1;2) (1:4) (3:2) (2;4): initial (0 1;2) (1:4) (3:2) (2;4)
generated: (0 1 ;2 4) (0 1 3;2) (1 3;2 4) (1 2;4)generated: (0 1 ;2 4) (0 1 3;2) (1 3;2 4) (1 2;4)
(0 1 3;2 4)(0 1 3;2 4)
15
DichotomiesDichotomies• Dichotomy d1 Dichotomy d1 coverscovers d2 if d2 if
1.1.the left block of d1 contains the left block of d2, the left block of d1 contains the left block of d2, andand
2.2.the right block of d1 contains the right block of d2the right block of d1 contains the right block of d2
(s0;s1 s2) is covered by (s0 s3;s1 s2 s4)(s0;s1 s2) is covered by (s0 s3;s1 s2 s4)• A dichotomy is a A dichotomy is a primeprime compatible of a given set if it is not compatible of a given set if it is not
covered by any other compatible of the set.covered by any other compatible of the set.• A set of complete dichotomies generates an A set of complete dichotomies generates an encoding:encoding: Each Each
dichotomy generates a bit of the encodingdichotomy generates a bit of the encoding– The left block symbols are 0 in that bitThe left block symbols are 0 in that bit– The right block symbols are 1 in that bitThe right block symbols are 1 in that bit
Example:Example: (s0 s1;s2 s3) (s0 s1;s2 s3) andand (s0 s3;s1 s2) ==> (s0 s3;s1 s2) ==>
s0=00, s1=01, s2=11, s3=10s0=00, s1=01, s2=11, s3=10
16
Input constraint Input constraint satisfactionsatisfaction
Initial dichotomies:Initial dichotomies:• EachEach face constraint with k symbols generates 2(n-k) initial dichotomies face constraint with k symbols generates 2(n-k) initial dichotomies (symbol (symbol
set (s0 s1 s2 s3 s4 s5))set (s0 s1 s2 s3 s4 s5))– (s1 s2 s4) ==> (s1 s2 s4) ==> (s1 s2 s4;s0) (s1 s2 s4;s3) (s1 s2 s4;s5) (s1 s2 s4;s0) (s1 s2 s4;s3) (s1 s2 s4;s5)
(s0;s1 s2 s4) (s3;s1 s2 s4) (s5;s1 s2 s4)(s0;s1 s2 s4) (s3;s1 s2 s4) (s5;s1 s2 s4) • Also require that each symbol is encoded uniquelyAlso require that each symbol is encoded uniquely
(s0;s1) (s0;s2) … (s0;s5)(s0;s1) (s0;s2) … (s0;s5)
(s1;s0) (s1;s2) … (s1;s5)(s1;s0) (s1;s2) … (s1;s5)
(s5;s0) (s5;s1) … (s5;s4)(s5;s0) (s5;s1) … (s5;s4)
nn22-n such additional initial dichotomies-n such additional initial dichotomies• All initial dichotomies, { d }, must be All initial dichotomies, { d }, must be satisfiedsatisfied by encoding - a dichotomy, d, is by encoding - a dichotomy, d, is
satisfied by a set of encoding dichotomies if there exists a bit where the satisfied by a set of encoding dichotomies if there exists a bit where the symbols in left block of d are 0 and the symbols in right block of d are 1.symbols in left block of d are 0 and the symbols in right block of d are 1.
NoteNote: can delete any initial dichotomy d that is covered by another e, since since : can delete any initial dichotomy d that is covered by another e, since since satisfaction of e implies satisfaction of d.satisfaction of e implies satisfaction of d.
17
Input constraint Input constraint satisfactionsatisfaction
Procedure:Procedure:
1.1. Given set of face constraints, generate Given set of face constraints, generate initial dichotomies.initial dichotomies.
2.2. Generate set of prime dichotomies.Generate set of prime dichotomies.
3.3. Form covering matrix Form covering matrix • Rows = initial dichotomiesRows = initial dichotomies• Columns = prime dichotomiesColumns = prime dichotomies• A 1 is in (i, j) if prime j covers dichotomy i.A 1 is in (i, j) if prime j covers dichotomy i.
4.4. Solve unate covering problemSolve unate covering problem
18
Efficient generation of Efficient generation of prime dichotomiesprime dichotomies
1.1. Introduce symbol for each initial dichotomyIntroduce symbol for each initial dichotomy
2.2. Form a 2-clause for each dichotomy a that is Form a 2-clause for each dichotomy a that is incompatible with dichotomy b i.e. (a+b)incompatible with dichotomy b i.e. (a+b)
3.3. Multiply product of all 2-clauses to SOP.Multiply product of all 2-clauses to SOP.
4.4. For each term in SOP, list dichotomies not in term - For each term in SOP, list dichotomies not in term - these are the set of all primes dichotomies.these are the set of all primes dichotomies.
Example:Example: initial dichotomies (a b c d e) initial dichotomies (a b c d e)
ab,ac,bc,cd,deab,ac,bc,cd,de are incompatibles are incompatiblesCNF is CNF is (a+b)(a+c)(b+c)(c+d)(d+e) = (a+b)(a+c)(b+c)(c+d)(d+e) =
abd+acd+ace+bcd+bceabd+acd+ace+bcd+bce
Primes are Primes are cUe, bUe, bUd, aUe, aUdcUe, bUe, bUd, aUe, aUd
19
Efficient generation of Efficient generation of prime dichotomiesprime dichotomies
Procedure for multiplying 2-CNF expression EProcedure for multiplying 2-CNF expression E
ProcedureProcedure cscs(E)(E)
x = splitting variablex = splitting variable
C = sum terms with xC = sum terms with x
R = sum terms without xR = sum terms without x
p = product of all variables in C except xp = product of all variables in C except x
q = q = cscs(R)(R)
resultresult = single_cube_containment(x q + p q) = single_cube_containment(x q + p q)
NoteNote: procedure is linear in number of primes: procedure is linear in number of primes
20
Applications of Input Applications of Input EncodingEncoding
References:References:• PLA decomposition with multi-input decoders [PLA decomposition with multi-input decoders [Sasao Sasao
1984, K.C.Chen and Muroga 1988, Yang and Ciesielski 1984, K.C.Chen and Muroga 1988, Yang and Ciesielski 19891989]]
• Boolean decomposition in Boolean decomposition in multi-levelmulti-level logic logic optimization optimization [Devadas, Wang, Newton, Sangiovanni [Devadas, Wang, Newton, Sangiovanni 1989]1989]
• Communication based logic partitioning Communication based logic partitioning [Beardslee [Beardslee 1992, Murgai 1993]1992, Murgai 1993]
• Approximation to state assignment Approximation to state assignment [De Micheli, [De Micheli, Brayton, Sangiovanni 1985, Villa and Sangiovanni Brayton, Sangiovanni 1985, Villa and Sangiovanni 1989]1989]
21
Input Encoding: PLA Input Encoding: PLA DecompositionDecomposition
Consider the PLA:Consider the PLA:
yy11 = x = x1 1 xx3 3 xx44’’ xx66+ x+ x2 2 xx5 5 xx66’’ xx7 7 + x+ x1 1 xx4 4 xx77’’ + x+ x11’’ xx33’’ xx4 4
xx77’’ + +
xx33’’ xx55’’ xx66’’ xx77’’
yy22 = x = x22’’ xx44’’ xx66+ x+ x3 3 xx44’’ xx6 6 + x+ x22’’ xx5 5 xx66’’ xx7 7 + x+ x11’’ xx33’’ xx4 4 xx77’ ’ ++ xx11’’ xx33’’ xx55’’ xx66’’ xx77’ + x’ + x22’’ xx44’’ xx55’’ xx77’’Decompose it into a Decompose it into a drivingdriving PLA fed by inputs PLA fed by inputs {{XX44, X, X55, X, X66, X, X7 7 }} and a and a drivendriven PLA fed by the outputs of the driving PLA and the PLA fed by the outputs of the driving PLA and the remaining inputs remaining inputs {{XX11, X, X22, X, X3 3 }} so as to minimize the area. so as to minimize the area.
xx4 4 xx5 5 xx66 x x77
xx4 4 xx5 5 xx66
yy1 1 yy22
22
Input Encoding: PLA Input Encoding: PLA DecompositionDecomposition
yy11 = x = x1 1 xx3 3 xx44’’ xx66+ x+ x2 2 xx5 5 xx66’’ xx7 7 + x+ x1 1 xx4 4 xx77’’ + x+ x11’’ xx33’’ xx4 4 xx77’’ + +
xx33’’ xx55’’ xx66’’ xx77’’
yy22 = x = x22’’ xx44’’ xx66+ x+ x3 3 xx44’’ xx6 6 + x+ x22’’ xx5 5 xx66’’ xx7 7 + x+ x11’’ xx33’’ xx4 4 xx77’ +’ + xx11’’ xx33’’ xx55’’ xx66’’ xx77’ + ’ + xx22’’ xx44’’ xx55’’ xx77’’
Projecting onto the selected inputs there are 5 distinct product terms:Projecting onto the selected inputs there are 5 distinct product terms:
xx44’’ xx6 6 , x, x5 5 xx66’’ xx7 7 , x, x4 4 xx77’’ , x, x55’’ xx66’’ xx77’ ,’ , xx44’’ xx55’’ xx77’’
Product term pairs (Product term pairs (xx4 4 xx77’’ ,, xx55’’ xx66’’ xx77’’ ) and ( ) and ( xx55’’ xx66’’ xx77’’ ,, xx44’’ xx55’’ xx77’’ )) are are notnot disjoint. disjoint.
23
PLA DecompositionPLA Decompositionyy11 = x = x1 1 xx3 3 xx44’’ xx66+ x+ x2 2 xx5 5 xx66’’ xx7 7 + x+ x1 1 xx4 4 xx77’’ + x+ x11’’ xx33’’ xx4 4 xx77’’ + + xx33’’ xx55’’ xx66’’ xx77’’
yy22 = x = x22’’ xx44’’ xx66+ x+ x3 3 xx44’’ xx6 6 + x+ x22’’ xx5 5 xx66’’ xx7 7 + x+ x11’’ xx33’’ xx4 4 xx77’ +’ + xx11’’
xx33’’ xx55’’ xx66’’ xx77’’ + + xx22’’ xx44’’ xx55’’ xx77’’
To re-encode make To re-encode make disjointdisjoint all product terms involving selected inputs: all product terms involving selected inputs:
yy11 = x = x1 1 xx3 3 xx44’’ xx66+ x+ x2 2 xx5 5 xx66’’ xx7 7 + x+ x1 1 xx4 4 xx77’’ + x+ x11’’ xx33’’ xx4 4 xx77’’ + + xx33’’
xx44’’ xx55’’ xx66’’ xx77’ ’ (using reduce)(using reduce)
yy22 = x = x22’’ xx44’’ xx66+ x+ x3 3 xx44’’ xx6 6 + x+ x22’’ xx5 5 xx66’’ xx7 7 + x+ x11’’ xx33’’ xx4 4 xx77’ +’ + xx11’’
xx33’’ xx44’’ xx55’’ xx66’’ xx77’’ + + xx22’’ xx44’’ xx55’’ xx66’’ xx77’ ’ (using reduce)(using reduce)
Projecting on the selected inputs there are 4 disjoint product terms:Projecting on the selected inputs there are 4 disjoint product terms:
xx44’’ xx6 6 , x, x5 5 xx66’’ xx7 7 , x, x4 4 xx77’’ , x, x44’’ xx55’’ xx66’’ xx77’’
View theseView these as 4 values as 4 values 1,2,3,4 1,2,3,4 of an MV variable S:of an MV variable S:
yy11 = x = x1 1 xx3 3 S S {1} {1} + x+ x2 2 S S {2}{2} + x+ x1 1 S S {3}{3}
+ x+ x11’’ xx33’’ S S {3}{3} + x+ x33’’ S S {4}{4}
yy22 = x = x22’’ S S {1} {1} + x+ x3 3 S S {1}{1} + x+ x22’’ S S {2}{2}
+ x+ x11’’ xx33’’ S S {3}{3} + x + x11’’ xx33’’ S S {4}{4} + x + x22’’ S S {4}{4}
24
Input Encoding: PLA Input Encoding: PLA DecompositionDecomposition
yy11 = x = x1 1 xx3 3 SS{1} {1} + x+ x2 2 SS{2}{2} + x+ x1 1 SS{3}{3}
+ x+ x11’’ xx33’’ SS{3}{3} + x+ x33’’ SS{4}{4}
yy22 = x = x22’’ SS{1} {1} + x+ x3 3 SS{1}{1} + x+ x22’’ SS{2}{2}
+ x+ x11’’ xx33’’ SS{3}{3} + x + x11’’ xx33’’ SS{4}{4} + x+ x22’’ SS{4}{4}
Performing MV two-level minimization:Performing MV two-level minimization:
yy11 = x = x1 1 xx3 3 S S {1,3} {1,3} + x+ x2 2 S S {2}{2} + x+ x33’’ S S {3,4}{3,4}
yy22 = x = x22’’ S S {1,2,4} {1,2,4} + x+ x3 3 S S {1}{1} + x+ x11’’ xx33’’ S S {3,4}{3,4}
Face constraints are: Face constraints are:
((1,3 1,3 ), (), (3,4 3,4 ), (), (1,2,4 1,2,4 ))
Codes of minimum length are: Codes of minimum length are:
enc(1 ) = 001, enc(2 ) = 011, enc(3) = 100, enc(4) = 111.enc(1 ) = 001, enc(2 ) = 011, enc(3) = 100, enc(4) = 111.xx1010
xx99
xx88
11
33
2244
25
Input Encoding: PLA Input Encoding: PLA DecompositionDecomposition
The The drivendriven PLA becomes: PLA becomes:
yy11 = x = x1 1 xx3 3 xx99’’ + x+ x2 2 xx88’x’x9 9 xx10 10 + x+ x33’ x’ x8 8
yy22 = x = x22’’ xx1010 + x+ x3 3 xx88’x’x99’x’x10 10 + x+ x11’’ xx33’ x’ x8 8
The The drivingdriving PLA becomes the function: PLA becomes the function:
f: f: {{XX44, X, X55, X, X66, X, X77}} {{XX88, X, X99, X, X1010}}
f(xf(x44’ x’ x6 6 ) = enc( 1 ) = 001) = enc( 1 ) = 001 f(xf(x55 x x66’ x’ x7 7 ) = enc( 2 ) = 011) = enc( 2 ) = 011
f(xf(x44 x x77’ ) = enc( 3 ) = 100’ ) = enc( 3 ) = 100 f(xf(x44’ x’ x55’’ xx66’’ xx77’ ) = enc( 4 ) = 111’ ) = enc( 4 ) = 111
Represented in SOP as:Represented in SOP as:
xx88 = x = x4 4 xx77’’ + x+ x44’ x’ x55’ x’ x66’ x’ x77’’
xx99 = x = x55 x x66’ x’ x7 7 + x+ x44’ x’ x55’ x’ x66’ x’ x77’’
xx1010 = x = x44’ x’ x66 + x + x55 x x66’ x’ x7 7 + x+ x44’ x’ x55’ x’ x66’ x’ x77’’
Result:Result: Area Area beforebefore decomposition: decomposition: 160160. .
Area Area afterafter decomposition: decomposition: 128 128..
xx4 4 xx5 5 xx66 x x77
xx4 4 xx5 5 xx66
xx88, x, x99, x, x1010
yy1 1 yy22
26
Output Encoding for Output Encoding for Two-Level Two-Level
ImplementationsImplementationsThe problem:The problem: • find binary codes for symbolic outputs in a logic function so find binary codes for symbolic outputs in a logic function so
as to minimize a two-level implementation of the function.as to minimize a two-level implementation of the function.
Terminology:Terminology:• Assume that we have a symbolic cover Assume that we have a symbolic cover S S with a symbolic with a symbolic
output assuming output assuming nn values. The different values are denoted values. The different values are denoted vv00, … , v, … , vn-1n-1..
• The encoding of a symbolic value The encoding of a symbolic value vvii is denoted is denoted enc(venc(vii).).
• The onset of The onset of vvii is denoted is denoted ONONii. . Each Each ONONii is a set of is a set of DDii minterms minterms {{mmi1i1, …, m, …, miDiiDi }}..
• Each minterm Each minterm mmij ij has a has a tagtag indicating which symbolic value’s indicating which symbolic value’s onset it belongs to. A minterm can only belong to one onset it belongs to. A minterm can only belong to one symbolic value’s onset. symbolic value’s onset.
27
Output EncodingOutput EncodingConsider a function Consider a function ff with symbolic outputs and two different encoded with symbolic outputs and two different encoded realizations of realizations of f f ::
0001 out1 0001 out1 0001 0010001 001 0001 100000001 10000
00-0 out2 00-0 out2 00-0 01000-0 010 00-0 0100000-0 01000
0011 out2 0011 out2 0011 0100011 010 0011 010000011 01000
0100 out3 0100 out3 0100 0110100 011 0100 001000100 00100
1000 out3 1000 out3 1000 0111000 011 1000 001001000 00100
1011 out4 1011 out4 1011 1001011 100 1011 000101011 00010
1111 out5 1111 out5 1111 1011111 101 1111 000011111 00001• Two-level logic minimization exploits the Two-level logic minimization exploits the sharingsharing between the different between the different
outputs to produce a minimum cover.outputs to produce a minimum cover.
In the second realization no sharing is possible. The first can be In the second realization no sharing is possible. The first can be minimized to: minimized to:
1111 0011111 001
1-11 1001-11 100
0100 0110100 011
0001 1010001 101
1000 0111000 011
00-- 01000-- 010
28
Dominance ConstraintsDominance ConstraintsDefinition: Definition: enc(venc(vii)) > > enc(venc(vjj)) iff the code of iff the code of vvii bit-wise dominates the code bit-wise dominates the code of of vvjj, i.e. for each bit position where , i.e. for each bit position where vvjj has a 1, has a 1, vvii also has a 1. also has a 1. Example:Example: 101 101 >> 001 001
If If enc(venc(vi i )) > > enc(venc(vj j )) then then ONONii can be used as a can be used as a DC setDC set when minimizing when minimizing
ONONjj..
Example:Example:
symbolic coversymbolic cover encoded coverencoded cover minimized encoded coverminimized encoded cover
0001 out10001 out1 0001 1100001 110 0001 110 0001 110
00-0 out200-0 out2 00-0 01000-0 010 00-- 010 00-- 010
0011 out20011 out2 0011 0100011 010
Here Here enc(out1)enc(out1) = 110 = 110 > > enc(out2)enc(out2) = 010= 010. The input minterm 0001 of . The input minterm 0001 of out1 has been included into the single cube 00-- that asserts the code of out1 has been included into the single cube 00-- that asserts the code of out2. out2. Algorithms to exploit dominance constraints implemented in Cappucino (De Michelli, 1986) Algorithms to exploit dominance constraints implemented in Cappucino (De Michelli, 1986) and Nova (Villa and Sangiovanni, 1990).and Nova (Villa and Sangiovanni, 1990).
29
Disjunctive ConstraintsDisjunctive ConstraintsIf If enc(venc(vi i ) = enc(v) = enc(vjj ) + enc(v) + enc(vkk ),), ON ONii can be minimized using can be minimized using ONONjj and and ONONk k
as don’t cares. as don’t cares.
Example:Example:
symbolic coversymbolic cover encoded coverencoded cover minimized encoded coverminimized encoded cover101 out1 1101 out1 1 101 11 1101 11 1 10- 01 1 10- 01 1
100 out2 1100 out2 1 100 01 1100 01 1 1-1 10 1 1-1 10 1
111 out3 1111 out3 1 111 10 1111 10 1
Here Here enc(out1)enc(out1) = enc(out2) + enc(out3)= enc(out2) + enc(out3). The input minterm 101 of out1 has . The input minterm 101 of out1 has been merged with the input minterm 100 of out2 been merged with the input minterm 100 of out2 (resulting in 10-)(resulting in 10-) and with the and with the input minterm 111 of out3 input minterm 111 of out3 (resulting in 1-1).(resulting in 1-1). Input minterm 101 now asserts 11 Input minterm 101 now asserts 11 (i.e. the code of out1),(i.e. the code of out1), by activating both cube 10- that asserts 01 and cube 1-1 by activating both cube 10- that asserts 01 and cube 1-1 that asserts 10.that asserts 10.
Algorithm to exploit dominance and disjunctive constraints implemented in Algorithm to exploit dominance and disjunctive constraints implemented in esp_sa (Villa, Saldanha, Brayton and Sangiovanni, 1995).esp_sa (Villa, Saldanha, Brayton and Sangiovanni, 1995).
30
Exact Output EncodingExact Output Encoding
Proposed by Proposed by Devadas and Newton, 1991.Devadas and Newton, 1991.
The The algorithmalgorithm consists of the following: consists of the following:
1.1. Generate generalized prime implicants Generate generalized prime implicants (GPIs)(GPIs) from the from the original symbolic cover.original symbolic cover.
2.2. Solve a constrained Solve a constrained coveringcovering problem, problem, • requires the selection of a minimum number of GPIs that requires the selection of a minimum number of GPIs that
form an form an encodeableencodeable cover. cover.
3.3. Obtain Obtain codescodes (of minimum length) that satisfy the encoding (of minimum length) that satisfy the encoding constraints.constraints.
4.4. Given the codes of the symbolic outputs and the selected Given the codes of the symbolic outputs and the selected GPIs, GPIs, constructconstruct trivially a PLA with product term cardinality trivially a PLA with product term cardinality equal to the number of GPIs.equal to the number of GPIs.