What makes a circuit good? We would prefer to design circuits with the following properties.
The primary factor affecting speed is the longest path (counting gates) from an input to the output. Generally, this path takes the longest to stabilize since each gate must wait for the previous gate.
The size of a circuit affects the cost of building the circuit. One advantage of a circuit over a boolean expression is that duplicate ``sub-terms'' may be reused. However, reuse of a sub-term may complicate the layout of a circuit.
One problem with big circuits is that laying out the circuit becomes difficult and the wire lengths involved become much longer which may introduce delays beyond that typical for the circuit depth. Particularly large circuits may also suffer slow-downs from propagation delay (the speed of light). We won't concern ourselves with reducing wire length since it is relatively independent the circuit's formula.
When constructing real circuits and analyzing their cost, we use
binary AND/OR gates - generalized
-ary gates are actually built
using
binary gates and add depth
.
We can place bounds on the minimum depth required to implement a
function. By computing the maximum size of a binary tree of a
particular height, we can show that the minimum depth of a function
using all
inputs is
. By computing
the size of the DNF formulas constructed to simulate truth tables, we
can show that the maximum required depth of a function is
(negation plus each variable
plus each assignment).
Circuits of
(logarithmic) depth are generally considered
fast while circuits of
(linear) depth are usually slow. Since a
circuit
inputs needs depth
to use
all
inputs, circuits with logarithmic depth are within a constant
factor of optimal. Circuits of logarithmic depth also have the
property that they have polynomial size even without sharing. Circuits
of linear depth lack this property.