(Two-level) Logic Synthesis
Implicants and Prime Implicants
Becker/Molitor, Chapter 7.2
Jan Reineke
Universität des Saarlandes
Prime implicants System Architecture, Jan Reineke
Implicants and prime implicants
A Boolean function f Î Bn is less than or equal to
another Boolean function g Î Bn (f ≤ g), if "a Î Bn: f(a) ≤ g(a).
(i.e. if f is 1, then so is g).
Def. (Implicant): Let f be a Boolean function with one output.
An implicant of f is a monomial q with y(q) ≤ f.
Def. (Prime implicant):
A prime implicant of f is a maximal implicant q of f,
i.e., there is no implicant s (s ≠ q) of f with y(q) ≤ y(s).
Illustration via n-dimensional hypercubes
• An implicant of f is a subcube that contains only marked nodes.
• A prime implicant of f is a maximal such subcube.
Prime implicants System Architecture, Jan Reineke
Implicants and prime implicants
0111 1111
Implicants:
• all marked nodes,
1101 • all edges whose nodes all are marked,
0101
• all surfaces whose nodes all are marked,
0110
• all 3-dimensional subcubes
1110
whose nodes all are marked.
0100
1100
In general:
0010 Implicants are those subcubes
1010 whose nodes all are marked.
0011 1011
1000
0000
0001 1001
Prime implicants System Architecture, Jan Reineke
Implicants and prime implicants
0111 1111
1101 The function defining our
0101
0110 hypercube has 3 prime implicants:
1110
0100
1100
• x2
0010 1010
0011 1011
1000
0000
0001 1001
Prime implicants System Architecture, Jan Reineke
Implicants and prime implicants
0111 1111
1101 The function defining our
0101
0110 hypercube has 3 prime implicants:
1110
0100
1100
• x2
0010 1010 • x1'x3'
0011 1011
1000
0000
0001 1001
Prime implicants System Architecture, Jan Reineke
Implicants and prime implicants
0111 1111
1101 The function defining our
0101
0110 hypercube has 3 prime implicants:
1110
0100
1100
• x2
0010 1010 • x1'x3'
0011 1011 • x3'x4
1000
0000
0001 1001
Prime implicants System Architecture, Jan Reineke
Polynomials and implicants
of a function f
Lemma:
All monomials of a polynomial p of f are implicants of f.
Proof (by contradiction)
Let p be a polynomial of f and let m be a monomial of p.
Assume for a contradiction that m is not an implicant of f, i.e., y(m) ≤ f does not hold.
Thus, there must be a valuation (a1,...,an) of the variables (x1,...,xn) with
• f(a1,...,an) = 0, but
• y(m)(a1,...,an) = 1, and so also y(p)(a1,...,an) = 1.
However, by assumption p is a polynomial of f, and so y(p)(a1,...,an) = f(a1,...,an). Contradiction!
Prime implicants System Architecture, Jan Reineke
Cheapest covering of all marked nodes
We are searching for a polynomial f of minimal cost, i.e.,
we are searching for a so-called minimal polynomial:
Definition:
A minimal polynomial p of a Boolean function f
is a polynomial of f of minimal cost, i.e., a polynomial of f,
s.t., cost(p) ≤ cost(p') for all (other) polynomials p' of f.
Prime implicants System Architecture, Jan Reineke
Prime Implicant Theorem of Quine
Theorem (Quine):
Every minimal polynomial p of a
Boolean function f consists only of
prime implicants of f.
Proof (by contradiction) Willard Quine (1928-2000)
Assume that p contains an implicant of f that is not prime.
Thus, m is covered by a prime implicant m' of f. In other words, it is contained in m'.
By definition of cost, we have cost(m') < cost(m).
Replacing the implicant m by the prime implicant m', we obtain another polynomial p',
that is still a polynomial of f, s.t. cost(p') < cost(p).
This contradicts the assumption that p is a minimal polynomial!
à To construct a minimal polynomial of a
Boolean function f, we should first find its prime implicants!
Computation of implicants (1/2)
Lemma 1:
If m is an implicant of f, then so are m×x and m×x' for
every variable x that occurs neither as positive or
negative literal in m.
Proof
More formally: By assumption, m is an implicant of f, i.e.: y(m) ≤ f.
y(m) = y(m)×(y(x)+¬y(x)) (Complements)
= y(m)×(y(x)+y(x')) (Definition of y)
= y(m)×y(x)+y(m)×y(x') (Distributivity)
= y(m×x)+y(m×x‘) ≥ y(m×x), y(m×x') (Definition of y)
So we have: y(m×x), y(m×x') ≤ f, i.e. m×x and m×x' are also
implicants of f.
System Architecture, Jan Reineke
Computation of implicants (2/2)
Lemma 2:
If m×x and m×x' are implicants of f, then so is m.
Proof
As m×x and m×x' are implicants of f, by definition of implicants, we
have f ≥ y(m×x) and f ≥ y(m×x').
Thus, we also have f ≥ y(m×x)+y(m×x')
f ≥ y(m×x)+y(m×x')
= y(m)×y(x)+y(m)×y(x') (Definition of y)
= y(m)×(y(x)+y(x')) (Distributivity)
= y(m)×(y(x)+¬y(x)) (Definition of y)
= y(m) (Complements)
Characterization of implicants
Theorem (Implicants):
A monomial m is an implicant of f if and only if, either
• m is a minterm of f, or
• m×x and m×x' are implicants of f
for a variable x that does not occur in m.
Thus:
m Î Implicant(f) Û
[m Î Minterm(f)] Ú [m×x, m×x' Î Implicant(f)]
Proof
Follows directly from Lemma 1 and Lemma 2.
Prime implicants System Architecture, Jan Reineke