Escolar Documentos
Profissional Documentos
Cultura Documentos
The problem:
Assign a unique code to each state to produce a minimal binary logic level
implementation.
Given:
1. |S| states,
2. at least log |S| state bits (minimum width encoding),
3. at most |S| state bits (one-hot encoding)
estimate impact of encoding on the size and delay of the optimized
implementation.
Most known techniques are directed towards reducing the size. Difficult
to estimate delay before optimization.
2n n
There are S S ! possible state assignments for 2 codes (n log |S| ),
since there are that many ways to select |S| distinct state codes and
|S|! ways to permute them among the states. 1
State Assignment
Techniques are in two categories:
Heuristic techniques try to capture some aspect of the process of
optimizing the logic, e.g. common cube extraction.
Example:
1. Construct a weighted graph of the states. Weights express
the gain in keeping the codes of the pair of states close.
2. Assign codes that minimize a proximity function (graph
embedding step)
Exact techniques model precisely the process of optimizing the
resulting logic as an encoding problem.
Example:
1. Perform an appropriate multi-valued logic minimization
(optimization step)
2. Extract a set of encoding constraints, that put conditions on
the codes
3. Assign codes that satisfy the encoding constraints 2
SA as an Encoding Problem
State assignment is a difficult problem: transform optimally
a cover of multi-valued (symbolic) logic functions into
an equivalent cover of two-valued logic functions.
3
Encoding Problems: status
two-level multi-level
well understood theory Input basic theory developed
efficient algorithms Encoding algorithms not yet mature
many applications few applications
two-level
Input-
multi-level
well understood theory Output no theory
no efficient algorithm Encoding heuristic algorithms
few applications few applications
4
Input Encoding for Two-
Level Implementations
Reference: [De Micheli, Brayton, Sangiovanni 1985]
Minimized result:
y = X {0,2,3} c1 c2+ X {0,2}c1+ X {1,2,3}c1c2
8
Input Encoding
Extraction of face constraints:
y = X {0,2,3} c1 c2+ X {0,2}c1+ X {1,2,3}c1c2
y = X {0,2,3} c
1 c2 + X {0,2}c1+ X {1,2,3}c1c2 x3 dc
dc
-> x2 c1 c2+ x2 x3 c1+ x1 c1c2 x2
dc 3
Note: needed 3 bits instead of the minimum 2. 10
x1
Procedure for Input
Encoding
Summary:
A face constraint is satisfied by an encoding if the supercube
of the codes of the symbolic values in the literal does not
contain any code of a symbolic value not in the literal.
17
Efficient generation of
prime dichotomies
1. Introduce symbol for each initial dichotomy
2. Form a 2-clause for each dichotomy a that is
incompatible with dichotomy b i.e. (a+b)
3. Multiply product of all 2-clauses to SOP.
4. For each term in SOP, list dichotomies not in term
- these are the set of all primes dichotomies.
Example: initial dichotomies (a b c d e)
ab,ac,bc,cd,de are incompatibles
CNF is (a+b)(a+c)(b+c)(c+d)(d+e) =
abd+acd+ace+bcd+bce
Primes are cUe, bUe, bUd, aUe, aUd
18
Efficient generation of
prime dichotomies
Procedure for multiplying 2-CNF expression E
Procedure cs(E)
x = splitting variable
C = sum terms with x
R = sum terms without x
p = product of all variables in C except x
q = cs(R)
result = single_cube_containment(x q + p q)
Note: procedure is linear in number of primes
19
Applications of Input
Encoding
References:
PLA decomposition with multi-input decoders
[Sasao 1984, K.C.Chen and Muroga 1988, Yang and
Ciesielski 1989]
Boolean decomposition in multi-level logic
optimization [Devadas, Wang, Newton, Sangiovanni
1989]
Communication based logic partitioning [Beardslee
1992, Murgai 1993]
Approximation to state assignment [De Micheli,
Brayton, Sangiovanni 1985, Villa and Sangiovanni
1989]
20
Input Encoding: PLA
Decomposition
Consider the PLA:
y1 = x1 x3 x4 x6+ x2 x5 x6 x7 + x1 x4 x7 + x1 x3 x4 x7 +
x3 x5 x6 x7
y2 = x2 x4 x6+ x3 x4 x6 + x2 x5 x6 x7 + x1 x3 x4 x7 +
x1 x3 x5 x6 x7 + x2 x4 x5 x7
Decompose it into a driving PLA fed by inputs {X4, X5, X6, X7 } and a
driven PLA fed by the outputs of the driving PLA and the remaining
inputs {X1, X2, X3 } so as to minimize the area.
y1 y2
x4 x5 x6
21
x4 x5 x6 x7
Input Encoding: PLA
Decomposition
y1 = x1 x3 x4 x6+ x2 x5 x6 x7 + x1 x4 x7 + x1 x3 x4 x7 +
x3 x5 x6 x7
y2 = x2 x4 x6+ x3 x4 x6 + x2 x5 x6 x7 + x1 x3 x4 x7 +
x1 x3 x5 x6 x7 + x2 x4 x5 x7
26
Output Encoding
Consider a function f with symbolic outputs and two different encoded
realizations of f :
0001 out1 0001 001 0001 10000
00-0 out2 00-0 010 00-0 01000
0011 out2 0011 010 0011 01000
0100 out3 0100 011 0100 00100
1000 out3 1000 011 1000 00100
1011 out4 1011 100 1011 00010
1111 out5 1111 101 1111 00001
Two-level logic minimization exploits the sharing between the different
outputs to produce a minimum cover.
In the second realization no sharing is possible. The first can be
minimized to: 1111 001
1-11 100
0100 011
0001 101
1000 011
27
00-- 010
Dominance Constraints
Definition: enc(vi) > enc(vj) iff the code of vi bit-wise
dominates the code of vj, i.e. for each bit position where vj has
a 1, vi also has a 1. Example: 101 > 001
If enc(vi ) > enc(vj ) then ONi can be used as a DC set when
minimizing ONj.
Example:
symbolic cover encoded cover minimized encoded cover
0001 out1 0001 110 0001 110
00-0 out2 00-0 010 00-- 010
0011 out2 0011 010
Here enc(out1) = 110 > enc(out2) = 010. The input minterm
0001 of out1 has been included into the single cube 00-- that
asserts the code of out2.
Algorithms to exploit dominance constraints implemented in Cappucino (De
Michelli, 1986) and Nova (Villa and Sangiovanni, 1990).
28
Disjunctive Constraints
If enc(vi ) = enc(vj ) + enc(vk ), ONi can be minimized using ONj
and ONk as dont cares.
Example:
symbolic cover encoded cover minimized encoded cover
101 out1 1 101 11 1 10- 01 1
100 out2 1 100 01 1 1-1 10 1
111 out3 1 111 10 1
Here enc(out1) = enc(out2) + enc(out3). The input minterm 101 of out1
has been merged with the input minterm 100 of out2 (resulting in 10-)
and with the input minterm 111 of out3 (resulting in 1-1). Input minterm
101 now asserts 11 (i.e. the code of out1), by activating both cube 10-
that asserts 01 and cube 1-1 that asserts 10.
30