G27
Self-checkedTier 2 12 min readdl.quine-mccluskey

Tabular method (Quine-McCluskey)

Minimising a Boolean function without a map: list the minterms in binary, group them by the number of ones, combine neighbouring groups that differ in one bit until nothing combines, read off the prime implicants, build the prime implicant chart, take the essential primes, delete dominated rows and columns, and settle what is left with Petrick's method; don't cares, products of sums, ties between minimum covers, and what the method costs.

Why it exists

A Karnaugh map is a picture: a person looks for the largest groups of ones. It is quick for three or four variables, awkward for five, and unusable beyond. The tabular method (Quine-McCluskey) finds the same groups by pure bookkeeping on binary numbers, so it works for any number of variables and is the form in which a program does two-level minimisation. The official syllabus names it next to the Karnaugh map, and the exam asks for its by-products: how many prime implicants, which are essential, which minterms combine in the first round.

Prerequisites

You need minterms, the sum of products form and the idea of an implicant from Boolean functions and their forms, and the groups, prime implicants and essential prime implicants of the Karnaugh map.

Precise definitions

Cube. A product term written as a string over 0, 1 and -, one position per variable (leftmost = most significant variable). 1 means the variable appears uncomplemented, 0 complemented, - absent. For A,B,C,DA, B, C, D: 10-0 is AB′D′AB'D'. A cube with kk dashes covers 2k2^k minterms.

Implicant. A cube all of whose minterms are in the ON-set or are don't cares. Prime implicant. An implicant that is not contained in a larger implicant (removing any literal would make it cover an OFF minterm). Essential prime implicant. A prime implicant that is the only one covering some ON minterm; it is in every cover.

Group. The number of ones in a cube. Adjacent cubes differ in exactly one position, and in that position neither has a dash; the dashes of the two cubes must be in the same places. Their combination has a dash in the differing position.

Cost of a cover. The number of product terms first, then the number of literals. A minimum cover is a cover of the ON-set by prime implicants of least cost.

The procedure.

  1. List the minterms and the don't cares in binary and sort them by group.
  2. Round 1: compare every cube of group gg with every cube of group g+1g+1. For each adjacent pair write the combined cube (once) in the next table and tick both cubes. Round 2, 3, ... repeat with the combined cubes, until a round produces nothing.
  3. Every cube that was never ticked is a prime implicant (in whichever round it stands).
  4. Build the prime implicant chart: rows are the prime implicants, columns the ON-set minterms only.
  5. Choose the essential prime implicants (a column with one X), delete the columns they cover. Delete dominated rows and columns. Repeat.
  6. If columns are left and several choices remain, use Petrick's method: for every column write the sum of the rows that cover it, multiply the sums out with X+XY=XX + XY = X and XX=XXX = X, and take the cheapest product.

How it works

Step 1 and 2: the combining rounds

Quine-McCluskey: combining rounds: start

Computed by a script, not typed
size: cubeGroup (ones)Cube ABCDCoversMerges with (gives)Result
1 minterm: 0000
1 minterm: 0001
1 minterm: 0010
1 minterm: 1000
1 minterm: 0101
1 minterm: 0110
1 minterm: 1001
1 minterm: 1010
1 minterm: 0111
1 minterm: 1110
2 minterms: -000
2 minterms: 00-0
2 minterms: 000-
2 minterms: -001
2 minterms: -010
2 minterms: 0-01
2 minterms: 0-10
2 minterms: 10-0
2 minterms: 100-
2 minterms: -110
2 minterms: 01-1
2 minterms: 011-
2 minterms: 1-10
4 minterms: -0-0
4 minterms: -00-
4 minterms: --10

Step 0

F(A,B,C,D) = sum m(0,1,2,5,6,7,8,9,10,14), no don't cares. Write every minterm in binary and sort by the number of ones (the group). Only cubes of NEIGHBOURING groups can combine, and only if they differ in exactly one position (a dash must meet a dash). A cube that combines is ticked; a cube that never combines is a prime implicant. Each size is a round; the next round repeats the procedure on the merged cubes.

0 / 26
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

The function is F(A,B,C,D)=∑m(0,1,2,5,6,7,8,9,10,14)F(A,B,C,D) = \sum m(0,1,2,5,6,7,8,9,10,14). The first ten rows are the minterms by group. Look at 0000 in group 0: it differs in exactly one bit from 0001, 0010 and 1000, so it produces 000-, 00-0 and -000 and is ticked. Round 2 combines the cubes of size 2: only cubes with the dash in the same place can merge, -000 with -001 gives -00-. The same cube can arise from two different pairs (-0-0 comes from -000 with -010 and from 00-0 with 10-0); it is written once. Round 2 produces three cubes of size 4, and round 3 finds no neighbours among them, so the process stops. The cubes without a tick are the prime implicants: A′C′DA'C'D (0-01), A′BDA'BD (01-1), A′BCA'BC (011-), B′D′B'D' (-0-0), B′C′B'C' (-00-), CD′CD' (--10).

Step 3 and 4: the chart

Quine-McCluskey: prime implicant chart: start

Computed by a script, not typed
prime implicantm0m1m2m5m6m7m8m9m10m14Literals
P1: CD' (--10)
P2: B'D' (-0-0)
P3: B'C' (-00-)
P4: A'C'D (0-01)
P5: A'BD (01-1)
P6: A'BC (011-)

Step 0

Rows are the prime implicants, columns are the minterms of the ON-set (a don't care would never get a column). An X says that the prime implicant covers the minterm. The chart is built one row at a time here.

0 / 6
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

Each row marks the minterms the prime implicant covers. A column with a single X names an essential prime implicant: m9m_9 is covered only by B′C′B'C', m14m_{14} only by CD′CD'. Columns are only the ON-set: a don't care is allowed to be covered but never has to be.

Step 5: essential primes and dominance

Quine-McCluskey: essential primes and dominance: start

Computed by a script, not typed
stepActionPrime implicant / columnReasonColumns leftChosen so far
step 1
step 2
step 3
step 4

Step 0

Repeat until nothing changes: (1) a column with a single X makes its row essential; choose the row, delete the columns it covers; (2) delete a row that another row dominates; (3) delete a column that another column dominates.

0 / 4
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

B′C′B'C' and CD′CD' are chosen, which removes m0,m1,m8,m9m_0, m_1, m_8, m_9 and m2,m6,m10,m14m_2, m_6, m_{10}, m_{14}. Left are m5m_5 and m7m_7. Row A′C′DA'C'D covers only m5m_5, row A′BDA'BD covers both, at the same literal cost, so A′C′DA'C'D is dominated and deleted. Now m5m_5 has a single X: A′BDA'BD is chosen, and the chart is empty. The answer is F=CD′+B′C′+A′BDF = CD' + B'C' + A'BD (3 terms, 7 literals). The prime implicant B′D′B'D' is never needed: all its minterms are covered by the others. A prime implicant can be essential, optional or useless.

Row dominance: row aa dominates row bb if aa covers every remaining column that bb covers, and costs no more. Delete bb. Column dominance: column xx is dominated by column yy if every row that covers yy also covers xx. Delete xx (covering yy covers xx for free).

When no prime implicant is essential

A chart without essential prime implicants: start

Computed by a script, not typed
prime implicantm0m1m2m5m6m7
P1: B'C (-01)
P2: BC' (-10)
P3: A'C' (0-0)
P4: A'B' (00-)
P5: AC (1-1)
P6: AB (11-)

Step 0

F(A,B,C) = sum m(0,1,2,5,6,7). Six prime implicants, each covering two minterms, each minterm covered by two primes.

0 / 6
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

F(A,B,C)=∑m(0,1,2,5,6,7)F(A,B,C) = \sum m(0,1,2,5,6,7) has six prime implicants and every column has two X's. Nothing is essential, nothing dominates anything. Guessing a row does work (and many students do it), but nothing in the chart says which choices are cheapest, so we need a method that looks at all of them.

Petrick's method

Petrick's method: start

Computed by a script, not typed
afterFactorProducts so far (after absorption)Number of products
column m0
column m1
column m2
column m5
column m6
column m7

Step 0

One factor per column: the sum of the prime implicants that cover it. A cover is a product that picks at least one prime from every factor. Multiply the factors one by one; remove every product that contains another product.

0 / 6
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

For each column write "one of the rows covering it must be chosen": (P3+P4)(P_3 + P_4) for m0m_0, (P1+P4)(P_1 + P_4) for m1m_1, and so on. A cover is a choice that satisfies all the factors, which is the product of the sums. Multiply them out step by step; after each multiplication delete every product that contains another product (X+XY=XX + XY = X), because it is a more expensive cover of the same thing. What is left are the irredundant covers. The cheapest are P1P3P6P_1 P_3 P_6 and P2P4P5P_2 P_4 P_5: B′C+A′C′+ABB'C + A'C' + AB and BC′+A′B′+ACBC' + A'B' + AC, both 3 terms and 6 literals. The minimum cover is not unique; both are correct answers, and the exam may offer both among the options.

Don't cares

Don't cares in the tabular method: start

Computed by a script, not typed
treatmentPrime implicantsEssential primesMinimum coverCost
Don't cares as 0
Don't cares as don't cares
Don't cares as 1

Step 0

F(A,B,C,D) = sum m(0,1,2,3,4,8) with don't cares d(5,12). The same function handled three ways. Only the middle row is the tabular method.

0 / 3
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

Don't cares take part in the combining step (they let the cubes grow, so the terms get shorter) but they have no column in the chart (nobody has to cover them). Throwing them away gives a more expensive answer (more literals); making them columns is also wrong (a cover would have to cover things it need not). The second row is the method.

Product of sums

To get a minimum product of sums, run the same procedure on the OFF-set (the maxterms) to get a minimum sum of products for F′F', then complement it with De Morgan: every product term becomes a sum term with the literals complemented. For FF above, the OFF-set is {3,4,11,12,13,15}\{3,4,11,12,13,15\}; the method gives F′=B′CD+BC′D′+ABDF' = B'CD + BC'D' + ABD (3 terms, 9 literals), so F=(B+C′+D′)(B′+C+D)(A′+B′+D′)F = (B + C' + D')(B' + C + D)(A' + B' + D').

What the method costs

The number of cubes in the tables and of products in Petrick's method can grow very fast with the number of variables. The largest number of prime implicants over all functions is 2, 6 and 13 for 2, 3 and 4 variables:

How often is the chart cyclic?: start

Computed by a script, not typed
variablesFunctionsMost prime implicantsNo column with a single XChoice left after reduction (Petrick)
2 variables
3 variables
4 variables

Step 0

Every function of 2, 3 and 4 variables (no don't cares) was run through the method. A chart without any essential prime implicant is rare (584 of 65536 for four variables), but a choice that is left after the essentials and the dominance steps is common.

0 / 3
computed by script: the tabular method of scripts/qm_lib.py is run on the functions. python3 scripts/gen-qm-traces.py

Charts without any essential prime implicant are rare (584 of the 65536 four-variable functions), but a choice left after the essential primes and the dominance steps is common (21656), so Petrick's method or a tie-break is a normal part of the work. The covering step is the hard part; the combining step only enumerates.

Worked examples

EX 1One round by hand

Easy

F(A,B,C)=∑m(1,3,5,7)F(A,B,C) = \sum m(1,3,5,7). Group 1: 001; group 2: 011, 101; group 3: 111. Round 1: 001+011 gives 0-1; 001+101 gives -01; 011+111 gives -11; 101+111 gives 1-1. Round 2: 0-1+1-1 gives --1, and -01+-11 gives --1 as well (written once). Only --1 is never ticked: the single prime implicant is CC, so F=CF = C.

EX 2With don't cares: F = sum m(4,8,10,11,12,15) + d(9,14)

Medium

List 4, 8, 9, 10, 11, 12, 14, 15 (the don't cares included): group 1: 0100, 1000; group 2: 1001, 1010, 1100; group 3: 1011, 1110; group 4: 1111. Round 1 gives -100, 100-, 10-0, 1-00, 10-1, 101-, 1-10, 11-0, 1-11, 111-. Round 2: 10-- (from 100- and 101-, also from 10-0 and 10-1), 1--0 (from 10-0 and 11-0, also from 1-00 and 1-10), 1-1- (from 101- and 111-, also from 1-10 and 1-11). The cube -100 found no partner. Prime implicants: BC′D′BC'D', AB′AB', AD′AD', ACAC.

Chart columns: m4,m8,m10,m11,m12,m15m_4, m_8, m_{10}, m_{11}, m_{12}, m_{15} (not 9 or 14). m4m_4 is covered only by BC′D′BC'D' (covers 4, 12), m15m_{15} only by ACAC (covers 10, 11, 14, 15). After them only m8m_8 is left, and both AB′AB' and AD′AD' cover it with two literals each. So there are two minimum covers: BC′D′+AC+AD′BC'D' + AC + AD' and BC′D′+AC+AB′BC'D' + AC + AB' (3 terms, 7 literals each). Both are correct.

EX 3Counting questions

Medium

For F=∑m(0,1,2,5,6,7,8,9,10,14)F = \sum m(0,1,2,5,6,7,8,9,10,14) (the first table): the first column has 10 cubes, the second 13, the third 3; the function has 6 prime implicants, 2 of them essential at the start (B′C′B'C' and CD′CD'), and the third prime A′BDA'BD becomes necessary after the dominance step. The minimum sum of products has 3 terms and 7 literals. In the tabular method "the number of terms in the second column" depends on the function and on how duplicates are counted: a cube that arises from two pairs is written once.

EX 4Typical questions

GATE level

(a) "Which of these cubes can be formed in round 1 from the minterms ...?" Check "exactly one bit differs": 0101 and 0111 give 01-1, but 0101 and 0110 differ in two bits and do not combine. (b) "How many prime implicants has F?" Count the cubes that were never ticked, from every round. (c) "Which prime implicants are essential?" A column with a single X. (d) "The minimum expression is not unique": after the essential primes, check whether two remaining rows can cover the rest at the same cost. (e) "Cost of the cover": terms first, then literals; read the question for the cost it uses (gates, literals, inputs). (f) "Which method gives a minimum product of sums?" The same method on the zeros, complemented.

Cheat box

Cheat box

  • Cube = string over 0, 1, -. Group = number of ones. Combine neighbouring groups that differ in exactly one position, dashes in the same places.
  • Tick the cubes that were used; the cubes never ticked (in any round) are the prime implicants.
  • Include the don't cares when combining; leave them out of the chart columns.
  • Chart: rows = prime implicants, columns = ON minterms. A column with one X gives an essential prime.
  • Reduce: essential primes, row dominance (covers at least as much, no more literals), column dominance. Then Petrick: product of sums, absorb X+XY=XX + XY = X, take the cheapest product.
  • Minimum cover: fewest terms, then fewest literals; it need not be unique.
  • Product of sums: run the method on the OFF-set and complement.

Traps and GATE patterns

Connections

The Karnaugh map and the tabular method find the same prime implicants: a group on the map is a cube of the table. The result feeds the design of combinational circuits, where the cost of the cover is the number of gates and gate inputs.

PYQs

1 previous year question from your book. I re-solved each one myself (1 by running or simulating, 0 by reasoning only); the book's key is shown next to my answer. All PYQs

GATE 2026 · Set 1 · MSQQ2 · page 164 of the book
Consider a Boolean function F with the following
min-term expression:
F(P, Q, R, S) = Σm(1, 2, 3, 4, 5, 7, 10, 12, 13, 14)

Which of the following options is/are the minimal
sum-of-products expression(s) of F?
  • (a)P ̅S+ QR ̅ + P ̅Q ̅R+ Q ̅RS ̅
  • (b)P ̅S+ QR ̅ + P ̅QR ̅ + PRS ̅
  • (c)P ̅S+ QR ̅ + PQS ̅ + PRS ̅
  • (d)P ̅S+ QR ̅ + PQS ̅ + Q ̅RS ̅

Self-check

Question 1

Which of the pairs 0110/0111, 0110/1001, -110/1110, -110/0-10 can be combined, and what is the result?

Show answer

0110/0111 gives 011-. 0110/1001 differ in four positions, no. -110/1110 gives --10. -110/0-10 have their dashes in different places, no.

Question 2

A chart has columns m1,m2,m3m_1, m_2, m_3 and rows P1P_1 (covers m1,m2m_1, m_2), P2P_2 (covers m2,m3m_2, m_3), P3P_3 (covers m1,m3m_1, m_3). Is there an essential prime? What does Petrick's method give?

Show answer

No: every column has two X's. The factors are (P1+P3)(P1+P2)(P2+P3)(P_1 + P_3)(P_1 + P_2)(P_2 + P_3). Multiplying the first two gives P1+P2P3P_1 + P_2 P_3; times (P2+P3)(P_2 + P_3) gives P1P2+P1P3+P2P3P_1 P_2 + P_1 P_3 + P_2 P_3: any two rows are a cover, so there are three minimum covers of equal term count (the cost then depends on their literals).

Question 3

Why do the don't cares not get a column in the chart?

Show answer

A cover must contain every ON minterm and no OFF minterm; a don't care may be inside the cover or not. A column would force the cover to include it. The don't cares are only used earlier, to let the cubes grow.

Revision card

One-screen revision

  • Binary minterms (with don't cares), group by number of ones, combine neighbouring groups that differ in one bit, tick used cubes; unticked cubes = prime implicants.
  • Chart: ON-set columns only. One X in a column = essential. Then dominance, then Petrick.
  • Petrick: product of sums over the columns, absorb, cheapest product. Minimum cover not always unique.
  • POS: run on the zeros and complement.

References

  • ·Mano and Ciletti, Digital Design, 5th ed., Chapter 3 Gate-Level Minimization (the tabular method is treated in the older editions and in the exercises; check the edition)
  • ·Kohavi and Jha, Switching and Finite Automata Theory, Chapter 4 Minimization of switching functions (prime implicants, the covering problem, Petrick's method)

Verification

scripts/enum-checks/dl_qm_check.py compares the method (scripts/qm_lib.py) with the DEFINITIONS on 78403 functions: every function of 4 variables, every function of 2 and 3 variables with don't cares, random functions of 4 and 5 variables with don't cares. (1) The cubes found in round k of the combining step are exactly the implicants of the function with k dashes (205461 cubes); (2) the cubes that never combine are exactly the prime implicants from the definition (an implicant not contained in a larger implicant); (3) every cover returned is correct on the ON-set and the OFF-set and has the cost of the exhaustive minimum (fewest terms, then fewest literals) found by trying all subsets; the covers returned are minimum covers, and where no dominance step was used they are ALL the minimum covers; (4) every essential prime implicant (the only prime covering some minterm) is chosen; (5) an independent bit-mask version of the reduction agrees on whether a choice is left, for every function of 2, 3 and 4 variables, and the counts printed on the page are equal; (6) the numbers of the page examples. tests/dl-qm-traces.test.ts re-derives the implicants, the chart, the minimum covers of the examples and the counts in TypeScript. CONVENTIONS: a minimum cover has the fewest product terms and then the fewest literals; a row is deleted as dominated only if another row covers at least as much of what is left and is strictly better (more coverage or fewer literals), so two rows that are equal stay and Petrick's method finds both covers; the order of the rules is essential primes, rows, columns. Chapter references are from memory and need verification. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (conversions, signed ranges and flags, IEEE 754 fields and custom formats, Boolean identities and counts, K-map groups, adder carries, BCD correction, flip-flop conversions, counter sequences and T equations, state reduction, Quine-McCluskey rounds and covers, floating-point alignment and rounding); long C programs were not re-read line by line (they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose); tables and animations are machine output and were read, not re-run; No other defect found. Status raised to self-checked; verified needs a textbook or human check.

last verified: never