4. Selecting a Subset of Primes
In the last section, we discussed techniques to generate prime implicants from a given SOP Boolean equation. Now, we need to select a subset of the prime implicants that cover all the minterms. The approach of minimizing a SOP formula based on computing all primes and then selecting some of them to form a cover is called Quine-McCluskey procedure.
In this section, we will discuss Quine-McCluskey procedure and illustrate the same using examples.
Let us consider the following SOP formula:
. ![]()
The complete sum for the function (i.e., in terms of prime implicants) is
.![]()
The condition that any subset of primes must satisfy the Boolean formula is that, each minterm (for which the function is 1) is to be included in at least one prime implicant, which is in the subset. A subset of (prime) implicants that satisfies this requirement is called a SOP cover of the function, or simply a cover. The concept of “cover” can be represented by a constraint matrix. Each column of the constraint matrix corresponds to a prime implicant and each row corresponds to a minterm. Let C be the constraint matrix and let
be the element in row
and column
if the j -th prime covers (does not cover) the i -th minterm.
In the example, let us represent the prime implicants as follows.

Now the matrix C is as follows:

Given the constraint matrix, we need to find a subset of columns of minimum cost that covers all the rows. In other words, for every row there must be at least one selected column with a 1 in that row. In the example, we note that, columns PI3 and PI4 must be part of every solution, because the last two rows are singletons. If a row is a singleton, there is only one column that may cover it and that column must be selected. It may also be noted that prime implicates corresponding to PI3 (and PI4) are essential because they comprise minterm
which is not in amy other prime implicant. When we select some columns, we simplify the constraint matrix accordingly, by eliminating the selected columns and the rows covered by them; if we select PI3 and PI4 then the resultant constraint matrix is as follows.

From the resultant matrix, we can easily see that a complete solution may be obtained by adding either PI1 or PI2 to PI3 and PI4. In the first case we obtain
in the second, we obtain
In this case, both the solutions involve same number of literals. However, in a general case, we select the solution involving minimum literals.