Algorithm Search⌘K

Modelcore

Boolean network

Also called multi-level logic network.

A directed acyclic graph of nodes each with a local Boolean function of its fanins, the model of multi-level logic synthesis.

A Boolean network is the model of a combinational circuit that multi-level logic synthesis works on. It is a directed acyclic graph whose sources are the primary inputs, and each other node holds a local Boolean function of the nodes that feed it, usually as a small sum of products. Some nodes are marked as primary outputs. A node can hold any function, so the model sits between a single sum of products per output (two levels) and a gate-level Boolean circuit (fixed gates). The MIS system of Brayton, Rudell, Sangiovanni-Vincentelli and Wang (1987) made it the common data of logic synthesis, and the later and-inverter graph is a Boolean network with one kind of node.

The machine

Here the machine is the network itself: what its parts are, what function it computes, and which steps change it.

Structure. A Boolean network NN has a finite set of primary inputs X={x1,…,xn}X = \{x_1, \ldots, x_n\}, a finite set YY of internal nodes, and a directed acyclic graph G=(X∪Y,E)G = (X \cup Y, E). The fanins of a node y∈Yy \in Y are FI(y)={u:(u,y)∈E}\mathrm{FI}(y) = \{u : (u, y) \in E\}, and its fanouts are the nodes that it feeds. A primary input has no fanin. A list Z=(z1,…,zm)Z = (z_1, \ldots, z_m) of nodes are the primary outputs. The graph must be acyclic, which makes the circuit combinational.

Local functions. Each node y∈Yy \in Y with kk fanins u1,…,uku_1, \ldots, u_k holds a local function fy:{0,1}k→{0,1}f_y : \{0,1\}^k \to \{0,1\}. MIS and SIS store fyf_y as a sum of products over the literals uiu_i and uˉi\bar{u}_i, so a node can use each fanin in either phase and no separate inverter node is needed.

Global functions. Each node vv computes a global function gvg_v of the primary inputs. For a primary input gxi(x)=xig_{x_i}(x) = x_i, and for an internal node

gy(x)=fy(gu1(x),…,guk(x)).g_y(x) = f_y\big(g_{u_1}(x), \ldots, g_{u_k}(x)\big).

This is well defined because GG is acyclic: the nodes can be put in topological order, and each gyg_y is computed after the global functions of its fanins. The network realizes the multiple-output function x↦(gz1(x),…,gzm(x))x \mapsto (g_{z_1}(x), \ldots, g_{z_m}(x)). Two networks with the same inputs and outputs are equivalent when they realize the same function.

Steps of synthesis. The model does not have one machine step as a model of computation does. In its place, synthesis changes the network by a few operations, each of which keeps the function of every primary output. The names below are those of MIS.

  • Eliminate. Substitute the local function of a node into its fanouts and delete the node.
  • Decompose and factor. Split a large local function into several nodes, for example with algebraic division.
  • Extract. Make a new node for a divisor that several nodes share, as in kernel extraction.
  • Substitute. Rewrite a node with an existing node as a new fanin.
  • Simplify. Minimize a local function with the don't-care conditions that the rest of the network allows, such as the observability don't-cares.

Sequential networks. SIS adds latches. A network with latches may have cycles, but every cycle must pass through a latch. Cutting each latch into a new primary input and a new primary output gives a combinational network again. Retiming moves the latches of such a network.

What it counts

A Boolean network has no single cost. Tools count these:

  • Literals. The number of literals of all local functions. The SOP count adds the literals of each SOP. The factored-form count writes each local function as a formula of AND and OR over literals and counts its leaves. MIS uses the factored-form count as the estimate of area before technology mapping. For example, ac+ad+bc+bdac + ad + bc + bd has 8 SOP literals, and its factored form (a+b)(c+d)(a + b)(c + d) has 4.
  • Nodes and edges. The size of YY and of EE. For an and-inverter graph, where every node is a 2-input AND, the node count is the main cost.
  • Depth. The largest number of internal nodes on a path from a primary input to a primary output. It is the estimate of delay before mapping, and the DAG longest path computes it in O(∣X∣+∣Y∣+∣E∣)O(|X| + |Y| + |E|) time.
  • Fanout. The number of fanouts of a node, a proxy for load and wiring.

These counts only estimate the cost of the final circuit. The real area and delay depend on technology mapping and on the layout.

Example: two networks for a full adder. The inputs are a,b,ca, b, c. The outputs are the sum ss and the carry coco.

node local function literals
tt abˉ+aˉba \bar{b} + \bar{a} b 4
ss tcˉ+tˉct \bar{c} + \bar{t} c 4
uu aba b 2
vv tct c 2
coco u+vu + v 2

This network has 5 internal nodes, 14 literals and depth 3, on the path a→t→v→coa \to t \to v \to co. Eliminating every internal node except the outputs gives the two-level network

s=aˉbˉc+aˉbcˉ+abˉcˉ+abc,co=ab+ac+bc,s = \bar{a} \bar{b} c + \bar{a} b \bar{c} + a \bar{b} \bar{c} + a b c, \qquad co = a b + a c + b c,

with 2 nodes, 12+6=1812 + 6 = 18 literals and depth 1. Each SOP here is a minimum one: parity has exactly one cover, its four minterms, and a search over all covers of majority with at most three cubes finds none with fewer than 6 literals. So the multi-level network is smaller in literals and deeper. A check of all 8 input vectors confirms that both networks realize the full adder.

Relation to other models

  • Two-level logic. A sum of products per output is a Boolean network with one internal node per output, whose fanins are all primary inputs. Two-level logic minimization optimizes this special case.
  • Boolean circuit. A Boolean circuit is a Boolean network whose local functions come from a fixed basis, such as AND, OR and NOT with two inputs. A network allows any local function. Replacing each local SOP by AND and OR gates turns a network into a circuit with at most three gates per literal: one NOT for a complemented literal, one AND to join it to its cube, and one OR to join a cube to the sum.
  • And-inverter graph and majority-inverter graph. The and-inverter graph allows only 2-input AND nodes and puts inverters on the edges. The majority-inverter graph uses 3-input majority nodes. Both are Boolean networks with a small fixed basis, which makes hashing and local rewriting simple.
  • Binary decision diagram. A binary decision diagram is also a DAG, but each node is a multiplexer on one variable, and the reduced ordered form is canonical. A Boolean network is not canonical: many networks realize the same function, and the search among them is the task of synthesis.
  • Mapped netlist. After technology mapping, each node is a cell of a library or a lookup table of an FPGA. The netlist is still a Boolean network, with the local functions fixed by the cells.

Known results in the model

Evaluation. One input vector is simulated in one pass in topological order, in time linear in the number of literals and nodes. On a word RAM with words of ww bits, bit-parallel simulation runs ww vectors at once with the same number of word operations. So the truth tables of all nodes take O((L+∣Y∣)2n/w)O((L + |Y|) 2^n / w) word operations, where LL is the number of literals, and the depth takes linear time.

Equivalence is co-NP-complete. Deciding whether two networks are equivalent is co-NP-complete when the local functions are given as SOPs. It is in co-NP, since an input vector on which an output differs is a certificate, and it is checked by one simulation of each network. It is co-NP-hard: for a formula φ\varphi in conjunctive normal form, build one node for each clause, whose SOP is the sum of the literals of the clause, and one output node, whose SOP is the single cube of all clause nodes. This network is equivalent to the constant 0 network exactly when φ\varphi is unsatisfiable, and the unsatisfiable formulas form a co-NP-complete set by the Cook-Levin theorem. Boolean equivalence checking and SAT solvers decide it in practice.

Most functions need large networks. For n≥5n \ge 5, at most a fraction 2n−2n/42^{n - 2^n / 4} of the 22n2^{2^n} functions of nn variables are realized by a network of at most s=⌊2n/(4n)⌋s = \lfloor 2^n / (4n) \rfloor nodes with two fanins each. Proof. Pad a smaller network with unused nodes, so that it is enough to count networks of exactly ss nodes. Each node picks one of 16 local functions of two inputs and two fanins among at most n+sn + s nodes, and one of the n+sn + s nodes is the output. So there are at most 16s(n+s)2s+116^s (n + s)^{2s + 1} such networks. Since n+s≤2nn + s \le 2^n, this is at most 24s+(2s+1)n=2s(2n+4)+n2^{4s + (2s + 1) n} = 2^{s(2n + 4) + n}. For n≥5n \ge 5, s(2n+4)≤2n(2n+4)/(4n)≤342ns(2n + 4) \le 2^n (2n + 4) / (4n) \le \tfrac{3}{4} 2^n, so at most 2342n+n2^{\frac{3}{4} 2^n + n} functions have such a network, out of 22n2^{2^n}. □\square Shannon (1949) introduced this counting argument for relay circuits. It shows that small networks are rare, but it names no hard function. The best explicit lower bounds for circuits are far smaller; see circuit complexity.

Optimization is hard. Finding the smallest network that is equivalent to a given one is at least as hard as deciding equivalence, because the smallest network for a CNF formula φ∧z\varphi \wedge z, with a new variable zz, has no literal exactly when φ\varphi is unsatisfiable. The multi-level logic synthesis page gives the bounds for the main forms of the problem.

References

  1. Robert K. Brayton, Richard Rudell, Alberto Sangiovanni-Vincentelli and Albert R. Wang, MIS, a multiple-level logic optimization system, IEEE Transactions on Computer-Aided Design 6(6), 1987, pages 1062 to 1081, the Boolean network as the data of MIS, the local functions as sums of products, and the operations that change the network
  2. Robert K. Brayton, Gary D. Hachtel and Alberto L. Sangiovanni-Vincentelli, Multilevel logic synthesis, Proceedings of the IEEE 78(2), 1990, pages 264 to 300, the definition of the Boolean network, the literal count in factored form as the cost, and the network transformations
  3. SIS, a system for sequential circuit synthesis, the Boolean network with latches for sequential circuits
  4. Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, Chapter 8, Multiple-Level Combinational Logic Optimization, the models of combinational networks and their transformations
  5. Claude E. Shannon, The synthesis of two-terminal switching circuits, Bell System Technical Journal 28(1), 1949, pages 59 to 98, the counting argument that most functions of n variables need large circuits

Where this leads

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/8KEFG7/text.yaml