Algorithm Search⌘K

Definitionintro

Prime implicant

Also called prime cube.

An implicant that no longer implies the function if any literal is removed. Some minimum sum of products uses only prime implicants.

A prime implicant of a Boolean function ff is an implicant that no other implicant contains. Put another way, it is a product term that implies ff, but stops implying ff when any one of its literals is removed. Quine (1952) showed why primes matter: each cube of a cover can grow to a prime that contains it, and this never adds a cube or a literal. So some minimum sum of products uses only primes, and exact minimizers first list the primes and then choose some of them. A prime is essential when it alone covers some 1 point of ff; every cover by primes must use it. The number of primes can be very large: Chandra and Markowsky (1978) showed that the largest number for nn variables is between orders 3n/n3^n/n and 3n/n3^n/\sqrt{n}.

Definition

Let ff have on-set FF, don't-care set DD and off-set RR, and let Imp(f)\mathrm{Imp}(f) be its set of implicants, the cubes cc with c⊆F∪Dc \subseteq F \cup D.

Prime implicant. An implicant pp is prime if no implicant cc has p⊊cp \subsetneq c.

Literal form. An implicant pp is prime exactly when, for each literal ℓ\ell of pp, the cube p∖ℓp \setminus \ell (the cube pp with ℓ\ell removed) is not an implicant. Proof: if some p∖ℓp \setminus \ell is an implicant, it contains pp strictly, so pp is not prime. Conversely, if an implicant cc has p⊊cp \subsetneq c, then cc lacks some literal ℓ\ell of pp, and p⊊p∖ℓ⊆cp \subsetneq p \setminus \ell \subseteq c, so p∖ℓp \setminus \ell is an implicant.

Essential prime. A prime pp is essential if some minterm m∈Fm \in F lies in pp and in no other prime. Each implicant that contains mm lies in some prime, and that prime contains mm, so it is pp. Hence every cover made of primes contains every essential prime.

Redundant primes. The other primes are of two kinds. A non-essential prime is totally redundant if it lies inside the union of the essential primes and DD, and partially redundant otherwise. A totally redundant prime is in no minimum cover. Partially redundant primes are where the hard choices are.

Quine's theorem. Let the cost of a cover be (number of cubes, number of literals), compared in this order. Then every minimum cover of ff consists of primes. Proof: replace each cube cc of a minimum cover by a prime p⊇cp \supseteq c. The result is still a cover, since it contains the old union and stays in F∪DF \cup D. It has at most as many cubes, and if some cc was not prime, then pp has fewer literals than cc, so the cost drops. That contradicts minimality. If the cost is only the number of cubes, the same step shows that some minimum cover is prime.

Number of primes. Each of the 3n3^n cubes can be prime for some function, but not all at once. Chandra and Markowsky (1978) proved that the largest number of primes of an nn-variable function is Ω(3n/n)\Omega(3^n / n) and O(3n/n)O(3^n / \sqrt{n}). The lower bound uses the function that is 1 when the number of ones in the input is between n/3n/3 and 2n/32n/3. For n=1,2,3,4n = 1, 2, 3, 4 the largest numbers are 1, 2, 6 and 13.

Examples and non-examples

  • f=x1x2+xˉ1x3f = x_1 x_2 + \bar{x}_1 x_3. The primes are x1x2x_1 x_2, xˉ1x3\bar{x}_1 x_3 and x2x3x_2 x_3. The first two are essential: minterm 6 (110110) is only in x1x2x_1 x_2 and minterm 1 (001001) is only in xˉ1x3\bar{x}_1 x_3. The prime x2x3x_2 x_3 lies inside the union of the two essential primes, so it is totally redundant. It is the consensus of the two other terms. The minimum SOP is x1x2+xˉ1x3x_1 x_2 + \bar{x}_1 x_3.
  • Non-example. The minterm x1x2x3x_1 x_2 x_3 is an implicant of the same ff, but not prime: it lies in x1x2x_1 x_2, and removing x3x_3 keeps an implicant.
  • A table with a choice. Take f=∑m(4,8,10,11,12,15)f = \sum m(4, 8, 10, 11, 12, 15) with don't-cares d(9,14)d(9, 14) over x1x2x3x4x_1 x_2 x_3 x_4. Its primes are −100{-}100, 10−−10{-}{-}, 1−−01{-}{-}0 and 1−1−1{-}1{-}. The prime −100{-}100 is essential for minterm 4, and 1−1−1{-}1{-} is essential for minterm 15. Minterm 8 is then left, and it lies in two primes, 10−−10{-}{-} and 1−−01{-}{-}0. Each choice gives a minimum cover with 3 cubes and 7 literals.
  • No essential prime. The function that is 1 unless all three inputs are equal, ∑m(1,2,3,4,5,6)\sum m(1, 2, 3, 4, 5, 6), has the six primes 0−10{-}1, 01−01{-}, −01{-}01, −10{-}10, 1−01{-}0 and 10−10{-}. Each minterm lies in exactly two of them, so no prime is essential. This is a cyclic table. The minimum covers have 3 primes, for example {0−1,−10,10−}\{0{-}1, {-}10, 10{-}\}, while the cover {0−1,1−0,−01,−10}\{0{-}1, 1{-}0, {-}01, {-}10\} is prime and irredundant but has 4 cubes. This is the largest number of primes for 3 variables.
  • Don't-cares change the primes. For ∑m(1,3,6,7)\sum m(1, 3, 6, 7) with minterm 5 as a don't-care, the primes are x3x_3 and x1x2x_1 x_2. The cube xˉ1x3\bar{x}_1 x_3 is no longer prime because x3x_3 is now an implicant.
  • Unate functions. For x1+x2x_1 + x_2 the primes are x1x_1 and x2x_2, and both are essential. In a completely specified unate function every prime is essential, so the sum of all primes is the unique minimum SOP.

The sum of all primes of ff is a canonical SOP of ff. It is often called the Blake canonical form.

  • Implicant. A cube inside the on-set plus the don't-care set.
  • Quine-McCluskey. Lists all primes by merging cubes that differ in one variable, then solves the prime implicant table.
  • Petrick's method. Lists every irredundant choice of primes for the table, by multiplying out a product of sums.
  • Karnaugh map. Shows the primes as the largest rectangles of 1s, for up to four or five variables.
  • Set cover. Choosing primes to cover the on-set minterms is a set cover problem, with one set for each prime.
  • Espresso. Makes each cube of a cover prime, one at a time, without listing all primes.
  • Two-level logic minimization. The problem that the primes and the covering step solve.

References

  1. W. V. Quine, The problem of simplifying truth functions, American Mathematical Monthly 59(8), 521 to 531, 1952, prime implicants, and the theorem that a shortest normal formula is a sum of prime implicants
  2. W. V. Quine, A way to simplify truth functions, American Mathematical Monthly 62(9), 627 to 631, 1955, the consensus method for finding the prime implicants
  3. On the number of prime implicants, the lower bound of order 3^n/n and the upper bound of order 3^n/√n on the largest number of prime implicants of an n-variable function
  4. Robert K. Brayton, Gary D. Hachtel, Curtis T. McMullen and Alberto L. Sangiovanni-Vincentelli, Logic Minimization Algorithms for VLSI Synthesis, Kluwer, 1984, Chapter 2, Basic Definitions (prime and essential cubes, covers)
  5. Gary D. Hachtel and Fabio Somenzi, Logic Synthesis and Verification Algorithms, Kluwer, 1996, Chapter 4, Synthesis of Two-Level Circuits (Quine's theorem and essential primes)

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/76W0F8/text.yaml