Quine-McCluskey Method

A Karnaugh map is the fastest way to simplify a Boolean function of three or four variables, but it stops being practical at five or six, and a computer cannot "look" at a map. The Quine-McCluskey method (also called the tabular method) solves the same problem with a fixed, mechanical procedure. It always finds the minimal sum-of-products (SOP) form, and it is the idea behind many logic minimization programs.

In this lesson you will learn the procedure and apply it to three complete examples, including a function with don't-care conditions and a function with no essential prime implicants. If you need a refresher on minterms first, read the lesson on SOP and POS forms.

Learning objectives

After this lesson you will be able to:

  • Group minterms by the number of 1s in their binary code.
  • Combine terms that differ in exactly one bit to build the prime implicants.
  • Build a prime implicant chart and identify the essential prime implicants.
  • Choose extra prime implicants to cover the remaining minterms.
  • Handle don't-care conditions correctly.

The method in five steps

  1. List and group. Write every minterm (and every don't-care) in binary. Group them by how many 1s they contain.
  2. Combine. Compare terms in neighbouring groups. If two terms differ in exactly one bit, merge them and replace that bit with a dash. Mark the two original terms as "used".
  3. Repeat. Keep combining the new terms, column by column, until nothing more can be merged. Terms that were never marked as used are the prime implicants.
  4. Build the chart. Put the prime implicants in rows and the minterms you must cover in columns. A minterm that is covered by only one prime implicant makes that implicant essential.
  5. Cover. Take all essential prime implicants, then add the cheapest set of other prime implicants that covers the minterms still left.

Two rules are worth remembering. Terms can only merge if their dashes are in the same positions, and a term can be used in more than one merge. Don't-care terms take part in step 2, but they are left out of the columns in step 4, because you are not required to cover them.

Example 1: a full run with ten minterms

Simplify F(A,B,C,D) = m(0, 1, 2, 5, 6, 7, 8, 9, 10, 14).

Column 1: group by number of 1s

Group Minterm A B C D
0 0 0 0 0 0
1 1 0 0 0 1
1 2 0 0 1 0
1 8 1 0 0 0
2 5 0 1 0 1
2 6 0 1 1 0
2 9 1 0 0 1
2 10 1 0 1 0
3 7 0 1 1 1
3 14 1 1 1 0

Column 2: pairs that differ in one bit

Merged minterms A B C D
0, 1 0 0 0 -
0, 2 0 0 - 0
0, 8 - 0 0 0
1, 5 0 - 0 1
1, 9 - 0 0 1
2, 6 0 - 1 0
2, 10 - 0 1 0
8, 9 1 0 0 -
8, 10 1 0 - 0
5, 7 0 1 - 1
6, 7 0 1 1 -
6, 14 - 1 1 0
10, 14 1 - 1 0

The terms 1,5 and 5,7 and 6,7 cannot merge any further, so they are prime implicants. The others combine again.

Column 3: groups of four

Merged minterms A B C D
0, 1, 8, 9 - 0 0 -
0, 2, 8, 10 - 0 - 0
2, 6, 10, 14 - - 1 0

Nothing in column 3 can merge, so these three are prime implicants too. In total there are six:

Prime implicant Covers Expression
- - 1 0 2, 6, 10, 14 CD'
- 0 - 0 0, 2, 8, 10 B'D'
- 0 0 - 0, 1, 8, 9 B'C'
0 - 0 1 1, 5 A'C'D
0 1 - 1 5, 7 A'BD
0 1 1 - 6, 7 A'BC

Prime implicant chart. Look for minterms covered by only one row. Minterm 14 appears only in CD', and minterm 9 appears only in B'C'. So CD' and B'C' are the two essential prime implicants. Together they cover 0, 1, 2, 6, 8, 9, 10 and 14.

The minterms left over are 5 and 7. The implicant A'BD covers both, and it is the cheapest choice. B'D' is not needed at all, because its minterms are already covered.

Result: F = CD' + B'C' + A'BD

Example 2: don't-care conditions

Simplify F(A,B,C,D) = m(4, 8, 10, 11, 12, 15) with don't-cares d(9, 14).

Start with all eight terms, minterms and don't-cares together: 4, 8, 9, 10, 11, 12, 14, 15. Merging pairs and then quads gives four prime implicants:

Prime implicant Covers Expression
- 1 0 0 4, 12 BC'D'
1 - - 0 8, 10, 12, 14 AD'
1 - 1 - 10, 11, 14, 15 AC
1 0 - - 8, 9, 10, 11 AB'

Now build the chart using only the required minterms 4, 8, 10, 11, 12 and 15. Minterm 4 appears only in BC'D', and minterm 15 appears only in AC, so both are essential. They cover 4, 10, 11, 12 and 15. Only minterm 8 is left, and either AD' or AB' covers it at the same cost.

Result: F = BC'D' + AC + AB' (or equally F = BC'D' + AC + AD')

Notice how the don't-cares 9 and 14 made AC and AB' larger groups without forcing you to cover them.

Example 3: no essential prime implicants

Simplify F(A,B,C) = m(0, 1, 2, 5, 6, 7).

Merging the six minterms gives six prime implicants, each covering two minterms:

Prime implicant Covers Expression
0 0 - 0, 1 A'B'
0 - 0 0, 2 A'C'
- 0 1 1, 5 B'C
- 1 0 2, 6 BC'
1 - 1 5, 7 AC
1 1 - 6, 7 AB

Every minterm is covered by exactly two prime implicants, so there are no essential ones. This is called a cyclic chart. The method says to pick any prime implicant, follow the consequences, and compare. Here two covers of three terms each work, and both are minimal:

  • F = A'B' + BC' + AC
  • F = A'C' + B'C + AB

Neither is better than the other, so you can use whichever is easier to build.

Common mistakes

  • Merging terms with different dash positions. 0-01 and 01-1 cannot merge, even though they look close. The dashes must line up.
  • Merging terms that differ in two bits. Only a one-bit difference is allowed.
  • Marking a term as used and then forgetting it can still be used again. One term can take part in several merges.
  • Putting don't-cares in the chart. They help build larger groups, but they never need to be covered.
  • Stopping at the first cover. After the essential implicants, check which remaining implicant covers the most uncovered minterms.
  • Dropping prime implicants that look redundant too early. Decide after the chart is built, not before.

Practice problems

Simplify each function with the Quine-McCluskey method. You can check your result with the K-map tool or the Boolean calculator.

  1. F(A,B,C,D) = m(2, 3, 6, 7, 10, 11, 14, 15)

    Answer: F = C

  2. F(A,B,C,D) = m(0, 2, 8, 10)

    Answer: F = B'D'

  3. F(A,B,C) = m(1, 5, 7). Then repeat with the don't-care d(3).

    Answer: without the don't-care, F = B'C + AC. With d(3), the four minterms 1, 3, 5, 7 combine into one group, so F = C.

  4. F(A,B,C) = m(0, 1, 3, 7)

    Answer: F = A'B' + BC

Frequently asked questions

Is Quine-McCluskey better than a Karnaugh map? For up to four variables a K-map is quicker by hand. The tabular method wins when you have five or more variables, or when you want a procedure that a program can follow without any visual judgement.

Does the method always give the minimal answer? Steps 1 to 4 always find every prime implicant. Step 5 can have several equally good covers, as in Example 3. For large functions, finding the absolute minimum cover is a hard problem, so programs often use heuristics.

How are don't-cares handled? Include them when combining terms so that groups get bigger, but leave them out of the prime implicant chart, since you are not required to cover them.

To check your own simplifications, try the SOP and POS calculator and the truth table generator.

Next lesson: Adders and Subtractors