Techniqueadvanced
Ashenhurst-Curtis decomposition
Also called functional decomposition, Ashenhurst decomposition.
Writes f(X, Y) as g(h(X), Y) by counting the distinct columns of a decomposition chart, a method used in synthesis for lookup table FPGAs.
Ashenhurst-Curtis decomposition splits a Boolean function of two disjoint sets of variables into , where the new functions see only the bound set . It works on a decomposition chart: a table of with one column for each assignment of and one row for each assignment of . If the chart has distinct columns, the decomposition exists with functions exactly when . Ashenhurst (1957) proved the case , Curtis (1962) gave the general case, and Roth and Karp (1962) extended it to functions with don't-cares. The method fits lookup tables of FPGAs well, because each and have fewer inputs than , and Lai, Pedram and Vrudhula (1993) made it practical by reading the column count off a BDD.
In plain words
Suppose a function reads six switches, but your parts can read only four. Split the switches into two groups. Ask: for each setting of the first group, what does the function do as the second group changes? Write each answer as a column of a table. Often, many settings of the first group give the same column. If there are only two different columns, a small part can read the first group and say which column it is with one wire. A second part reads that wire and the second group and gives the answer. With four different columns you need two wires, and so on. The trick is to count the different columns, and to find a split of the switches with few of them.
When it applies
- A function has more inputs than one cell can take, as in an FPGA with -input lookup tables, and you want to split it into cells with fewer inputs.
- The function is given or can be built as a truth table or a BDD, so that its columns can be compared. A function of 20 inputs has a truth table of about bits, so the method works on single nodes or small groups of nodes of a Boolean network, not on a whole chip.
- Some set of inputs affects the output only through a few patterns. A symmetric function is an example: it depends on a bound set of variables only through the number of ones in it, so the columns of two assignments with the same count are equal and .
- The function has don't-cares that can merge columns, which can make smaller.
The template
Write for the bound set with variables and for the free set with the other variables. The column of an assignment of is the vector over all assignments of , in a fixed order. The column multiplicity is the number of distinct columns.
DECOMPOSE(f, n, s) ▷ f: a truth table on n variables; s: the size of the bound set- 1
for each bound set X of s variables, in the order of CHOOSE-BOUND-SETS do - 2
Y ← the other n - s variables - 3
for each assignment x of X do - 4
col[x] ← (f(x, y) for each assignment y of Y) - 5
P ← GROUP(col) ▷ a partition of the assignments of X into classes - 6
t ← ⌈lg |P|⌉ - 7
if t < s then - 8
e ← ENCODE(P, t) ▷ a distinct code of t bits for each class - 9
h(x) ← e(the class of x) for each assignment x of X - 10
g(c, y) ← col[x][y] for any x with h(x) = c; a don't-care if no x has the code c - 11
return (X, h, g) - 12
return fail
The template has three holes.
- CHOOSE-BOUND-SETS. All subsets, or a heuristic order that tries first the variables that appear together.
- GROUP. For a completely specified , the classes of equal columns, so . With don't-cares, a partition into classes of pairwise compatible columns, where two columns are compatible if they agree wherever both are specified.
- ENCODE. Any injective map from the classes to is correct. The choice changes the size of and .
Lines L3 and L4 build the decomposition chart one column at a time. Line L7 keeps only splits that save inputs: replaces variables by wires. Line L10 reads off the chart, and the codes of no class are don't-cares of .
Why it works (Curtis). For a completely specified , functions of and with exist if and only if . Proof. If , two assignments with have equal columns, since for all . So there are at most as many distinct columns as values of , which is . Conversely, if , give each distinct column its own code of bits, let be the code of , and let for any with . All such have the same column, because the code is injective, so is well defined and . The case , , is Ashenhurst's simple disjoint decomposition. With don't-cares, the same proof works for any partition into classes of pairwise compatible columns: each class has a common column that agrees with all of its members where they are specified.
Cost. For one bound set, the chart has entries. Hashing the columns finds the classes in expected word operations on a word RAM, when a column fits in a constant number of words. Trying all bound sets of size costs times this. Grouping with don't-cares is a coloring problem, below.
Worked example. Let , with the bound set and the free set .
| \ | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| 00 | 1 | 1 | 1 | 1 |
| 01 | 0 | 0 | 0 | 0 |
| 10 | 1 | 1 | 1 | 1 |
| 11 | 0 | 1 | 1 | 0 |
The columns of and are equal, and so are those of and , so and . With the code 0 for the first class and 1 for the second, . The column of class 0 is and the column of class 1 is , so . A script computed for every bound set. The other five bound sets of two variables have , so they need and give no saving. Of the bound sets of three variables, has , with and , has , and the other two have .
How often it works. A bound set of three variables of a 4-variable function leaves columns of 2 entries, so and always. So every function of 4 variables is for any bound set of 3 variables, with three functions of 3 inputs. Simple decompositions are rarer. An exhaustive count found that of the 64594 functions of 4 variables that depend on all 4, exactly 7354 have a bound set of 2 or 3 variables with .
Classic examples
- LUT mapping. A node with more than inputs is split with a bound set of at most variables, so that each fits in one lookup table, and is split again if it is still too large.
- Reduced ordered BDD. Put the bound variables first in the order. Each node of a reduced ordered BDD stands for one distinct subfunction, so is the number of distinct nodes reached from the root by the assignments of . Lai, Pedram and Vrudhula use this cut to find decompositions without a truth table.
- Myhill-Nerode theorem. The distinct columns are the distinct residual functions , in the same way that the states of a minimum DFA are the distinct residual languages of prefixes. Counting columns is counting these classes.
- Incompletely specified FSM minimization. Merging columns with don't-cares into compatible classes is the same problem as merging compatible states, and in both cases compatibility is not transitive.
- k-coloring. With don't-cares, build the graph with a vertex per column and an edge between incompatible columns. A partition of compatible classes is a proper coloring, and wires suffice if the graph is -colorable.
- State assignment. The choice of the codes in ENCODE is an encoding problem like the choice of state codes, with the same goal of simple logic after encoding.
Variations
- Simple disjoint decomposition. The case of Ashenhurst, where is a single function and has inputs.
- Several functions of the bound set. The general case of Curtis, with the test .
- Non-disjoint decomposition. Some variables go to both and : . For each assignment of the chart is split into its own part, and the classes are counted in each part, so the codes may differ between the parts.
- Don't-cares. Roth and Karp (1962) gave the tests for functions with don't-cares, where GROUP is a coloring of the incompatibility graph. The don't-cares of at unused codes, from line L10, can also make smaller.
- Multiple outputs. For several functions with the same bound set, the column is the tuple of their columns, and the functions are shared.
- BDD-based. The method of Lai, Pedram and Vrudhula (1993) reads off a BDD cut and builds and as BDDs, for both disjoint and non-disjoint bound sets.
Pitfalls
- Accepting a split that saves nothing. With and , and the split replaces two inputs by two wires. Line L7 must test , not , which always holds.
- Treating compatibility as an equivalence. The columns , and show the problem: the middle one is compatible with each of the others, but the first and the last conflict in their first entry. Putting all three in one class gives a wrong . GROUP must check every pair in a class. Finding the fewest classes is NP-hard in general, because every graph is the incompatibility graph of some chart: give each edge its own row, with 0 and 1 in the columns of its two ends and in the others, and then the fewest classes is the chromatic number.
- Treating as a third value. Comparing columns with as a symbol gives a correct result but throws away the freedom, so can be larger than needed.
- Forgetting the unused codes. When , some codes of never occur, and may take any value there. Fixing them to 0 can make larger.
- Truth tables of large functions. The chart has entries for each bound set, and there are bound sets. Use a BDD or a small window of the network for more than about 20 inputs.
References
- The decomposition of switching functions, decomposition charts and the test for a simple disjoint decomposition by the number of distinct columns
- A New Approach to the Design of Switching Circuits, the extension of decomposition charts to decompositions with several functions of the bound set
- J. Paul Roth and Richard M. Karp, Minimization over Boolean graphs, IBM Journal of Research and Development 6(2), 1962, pages 227 to 238, the tests for decompositions of incompletely specified functions and the search for a minimum cost circuit
- BDD based decomposition of logic functions with application to FPGA synthesis, disjunctive and nondisjunctive decomposition on a BDD, with the bound variables above a cut
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag WX0DTG Edit this page History Report an error Markdown