Logic optimization is a process of finding an equivalent representation of the specified
logic circuit under one or more specified constraints. This process is a part of a
logic synthesis applied in
digital electronics
Digital electronics is a field of electronics involving the study of digital signals and the engineering of devices that use or produce them. It deals with the relationship between Binary number, binary inputs and outputs by passing electrical s ...
and
integrated circuit design
Integrated circuit design, semiconductor design, chip design or IC design, is a sub-field of electronics engineering, encompassing the particular Boolean logic, logic and circuit design techniques required to design integrated circuits (ICs). A ...
.
Generally, the circuit is constrained to a minimum chip area meeting a predefined response delay. The goal of logic optimization of a given circuit is to obtain the smallest
logic circuit that evaluates to the same values as the original one.
Usually, the smaller circuit with the same function is cheaper,
takes less space,
consumes less power, has shorter latency, and minimizes risks of unexpected
cross-talk,
hazard of delayed signal processing, and other issues present at the nano-scale level of metallic structures on an
integrated circuit
An integrated circuit (IC), also known as a microchip or simply chip, is a set of electronic circuits, consisting of various electronic components (such as transistors, resistors, and capacitors) and their interconnections. These components a ...
.
In terms of
Boolean algebra
In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
, the optimization of a complex
Boolean expression is a process of finding a simpler one, which would upon evaluation ultimately produce the same results as the original one.
Motivation
The problem with having a complicated
circuit (i.e. one with many elements, such as
logic gate
A logic gate is a device that performs a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic gate, one that has, for ...
s) is that each element takes up physical space and costs time and money to produce. Circuit minimization may be one form of logic optimization used to reduce the area of complex logic in
integrated circuit
An integrated circuit (IC), also known as a microchip or simply chip, is a set of electronic circuits, consisting of various electronic components (such as transistors, resistors, and capacitors) and their interconnections. These components a ...
s.
With the advent of
logic synthesis, one of the biggest challenges faced by the
electronic design automation
Electronic design automation (EDA), also referred to as electronic computer-aided design (ECAD), is a category of software tools for designing Electronics, electronic systems such as integrated circuits and printed circuit boards. The tools wo ...
(EDA) industry was to find the most simple circuit representation of the given design description.
While
two-level logic optimization had long existed in the form of the
Quine–McCluskey algorithm, later followed by the
Espresso heuristic logic minimizer, the rapidly improving chip densities, and the wide adoption of
Hardware description language
In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, usually to design application-specific integrated circuits (ASICs) and to progra ...
s for circuit description, formalized the logic optimization domain as it exists today, including
Logic Friday (graphical interface), Minilog, and ESPRESSO-IISOJS (many-valued logic).
Methods
The methods of logic circuit simplifications are equally applicable to
Boolean expression minimization.
Classification
Today, logic optimization is divided into various categories:
;Based on circuit representation
: Two-level logic optimization
: Multi-level logic optimization
;Based on circuit characteristics
:Sequential logic optimization
:Combinational logic optimization
;Based on type of execution
:Graphical optimization methods
:Tabular optimization methods
:Algebraic optimization methods
Graphical methods
Graphical methods represent the required logical function by a diagram representing the logic variables and value of the function. By manipulating or inspecting a diagram, much tedious calculation may be eliminated.
Graphical minimization methods for two-level logic include:
* ''
Euler diagram
An Euler diagram (, ) is a diagrammatic means of representing Set (mathematics), sets and their relationships. They are particularly useful for explaining complex hierarchies and overlapping definitions. They are similar to another set diagrammi ...
'' (aka ''Eulerian circle'') (1768) by
Leonhard P. Euler (1707–1783)
* ''
Venn diagram'' (1880) by
John Venn
John Venn, Fellow of the Royal Society, FRS, Fellow of the Society of Antiquaries of London, FSA (4 August 1834 – 4 April 1923) was an English mathematician, logician and philosopher noted for introducing Venn diagrams, which are used in l ...
(1834–1923)
* ''
Karnaugh map
A Karnaugh map (KM or K-map) is a diagram that can be used to simplify a Boolean algebra expression. Maurice Karnaugh introduced the technique in 1953 as a refinement of Edward W. Veitch's 1952 Veitch chart, which itself was a rediscovery of ...
'' (1953) by
Maurice Karnaugh
Boolean expression minimization
The same methods of Boolean expression minimization (simplification) listed below may be applied to the circuit optimization.
For the case when the Boolean function is specified by a circuit (that is, we want to find an equivalent circuit of minimum size possible), the unbounded circuit minimization problem was long-conjectured to be
-complete in
time complexity
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
, a result finally proved in 2008,
but there are effective heuristics such as
Karnaugh map
A Karnaugh map (KM or K-map) is a diagram that can be used to simplify a Boolean algebra expression. Maurice Karnaugh introduced the technique in 1953 as a refinement of Edward W. Veitch's 1952 Veitch chart, which itself was a rediscovery of ...
s and the
Quine–McCluskey algorithm that facilitate the process.
Boolean function minimizing methods include:
*
Quine–McCluskey algorithm
*
Petrick's method
Optimal multi-level methods
Methods that find optimal circuit representations of Boolean functions are often referred to as ''exact synthesis'' in the literature. Due to the computational complexity, exact synthesis is tractable only for small Boolean functions. Recent approaches map the optimization problem to a
Boolean satisfiability problem.
This allows finding optimal circuit representations using a
SAT solver
In computer science and formal methods, a SAT solver is a computer program which aims to solve the Boolean satisfiability problem (SAT). On input a formula over Boolean data type, Boolean variables, such as "(''x'' or ''y'') and (''x'' or not ''y'' ...
.
Heuristic methods
A
heuristic
A heuristic or heuristic technique (''problem solving'', '' mental shortcut'', ''rule of thumb'') is any approach to problem solving that employs a pragmatic method that is not fully optimized, perfected, or rationalized, but is nevertheless ...
method uses established rules that solve a practical useful subset of the much larger possible set of problems. The heuristic method may not produce the theoretically optimum solution, but if useful, will provide most of the optimization desired with a minimum of effort. An example of a computer system that uses heuristic methods for logic optimization is the
Espresso heuristic logic minimizer.
Two-level versus multi-level representations
While a two-level circuit representation of circuits strictly refers to the flattened view of the circuit in terms of SOPs (
sum-of-products) — which is more applicable to a
PLA implementation of the design — a
multi-level representation is a more generic view of the circuit in terms of arbitrarily connected SOPs, POSs (
product-of-sums), factored form etc. Logic optimization algorithms generally work either on the structural (SOPs, factored form) or functional representation (
binary decision diagrams,
algebraic decision diagrams) of the circuit. In sum-of-products (SOP) form, AND gates form the smallest unit and are stitched together using ORs, whereas in product-of-sums (POS) form it is opposite. POS form requires parentheses to group the OR terms together under AND gates, because OR has lower precedence than AND. Both SOP and POS forms translate nicely into circuit logic.
If we have two functions ''F''
1 and ''F''
2:
:
:
The above 2-level representation takes six product terms and 24 transistors in CMOS Rep.
A functionally equivalent representation in multilevel can be:
: ''P'' = ''B'' + ''C''.
: ''F''
1 = ''AP'' + ''AD''.
: ''F''
2 = ''A
'P'' + ''A
'E''.
While the number of levels here is 3, the total number of product terms and literals reduce because of the sharing of the term B + C.
Similarly, we distinguish between
combinational circuits and
sequential circuits. Combinational circuits produce their outputs based only on the current inputs. They can be represented by Boolean
relations. Some examples are
priority encoders,
binary decoders,
multiplexer
In electronics, a multiplexer (or mux; spelled sometimes as multiplexor), also known as a data selector, is a device that selects between several Analog signal, analog or Digital signal (electronics), digital input signals and forwards the sel ...
s,
demultiplexers.
Sequential circuits produce their output based on both current and past inputs, depending on a clock signal to distinguish the previous inputs from the current inputs. They can be represented by finite state machines. Some examples are
flip-flops and
counters.
Example

While there are many ways to minimize a circuit, this is an example that minimizes (or simplifies) a Boolean function. The Boolean function carried out by the circuit is directly related to the algebraic expression from which the function is implemented.
Consider the circuit used to represent
. It is evident that two negations, two conjunctions, and a disjunction are used in this statement. This means that to build the circuit one would need two
inverters, two
AND gate
The AND gate is a basic digital logic gate that implements the logical conjunction (∧) from mathematical logic AND gates behave according to their truth table. A HIGH output (1) results only if all the inputs to the AND gate are HIGH (1). If a ...
s, and an
OR gate.
The circuit can simplified (minimized) by applying laws of
Boolean algebra
In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
or using intuition. Since the example states that
is true when
is false and the other way around, one can conclude that this simply means
. In terms of logical gates,
inequality simply means an
XOR gate (exclusive or). Therefore,
. Then the two circuits shown below are equivalent, as can be checked using a
truth table
A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...
:
See also
*
Binary decision diagram (BDD)
*
Don't care condition
*
Prime implicant
*
Circuit complexity — on estimation of the circuit complexity
*
Function composition
In mathematics, the composition operator \circ takes two function (mathematics), functions, f and g, and returns a new function h(x) := (g \circ f) (x) = g(f(x)). Thus, the function is function application, applied after applying to . (g \c ...
*
Function decomposition
*
Gate underutilization
*
Logic redundancy
*
Harvard minimizing chart (Wikiversity) (Wikibooks)
Notes
References
Further reading
* (146 pages)
* (NB. Chapters 7–9 cover combinatorial two-level, combinatorial multi-level, and respectively sequential circuit optimization.)
*
*
*
{{digital electronics
Electronic engineering
Electronic design
Digital electronics
Electronic design automation
Electronics optimization
Boolean algebra
Circuit complexity
Logic in computer science