Computer Science

How to Get a Simplified Sum of Products from a Truth Table

Updated 12 October 2026

At a glance

  1. 1. List the 1-rows

    Note every truth-table row where the output F equals 1.

  2. 2. Write the minterms

    AND every variable, complementing those that are 0 in that row.

  3. 3. OR them together

    This canonical sum of minterms is correct but not minimal.

  4. 4. Group and simplify

    Merge terms differing in one variable (XY + XY′ = X) with a K-map.

Try it: Boolean simplifier calculator

A truth table gives you the function completely. Turning it into a sum of products (SOP) expression takes two steps: write the canonical form, then simplify.

Step 1: the canonical SOP (sum of minterms)

For each row where the output FF is 1, write a minterm: the AND of every variable, where a variable appears plain if it is 1 in that row and complemented if it is 0. Then OR all the minterms.

Example truth table:

Row mmAABBCCFF
00000
10011
20100
30111
41000
51011
61101
71111

F=1F = 1 in rows 1, 3, 5, 6 and 7, so F=∑m(1,3,5,6,7)F = \sum m(1,3,5,6,7) and

F=A′B′C+A′BC+AB′C+ABC′+ABC.F = A'B'C + A'BC + AB'C + ABC' + ABC.

This expression is correct but not minimal.

Step 2a: simplify with Boolean algebra

The key identity is adjacency: XY+XY′=X(Y+Y′)=XXY + XY' = X(Y + Y') = X. Two terms that differ only in one variable merge and lose that variable.

  1. A′B′C+A′BC=A′CA'B'C + A'BC = A'C (they differ only in BB).
  2. AB′C+ABC=ACAB'C + ABC = AC.
  3. A′C+AC=CA'C + AC = C.
  4. ABC′+ABC=ABABC' + ABC = AB. Using ABCABC a second time is allowed, because X+X=XX + X = X.

So

F=C+AB.F = C + AB.

Check: row 6 (A=1,B=1,C=0A=1, B=1, C=0) gives 0+1=10 + 1 = 1 ✓. Row 4 (1,0,01,0,0) gives 0+0=00 + 0 = 0 ✓. Rows 0 and 2 give 00 ✓.

Step 2b: simplify with a Karnaugh map

The map orders the columns in Gray code (00,01,11,1000, 01, 11, 10), so neighbouring cells differ in one variable:

A\BCA \backslash BC00011110
00110
10111
  • The four 1s in columns 0101 and 1111 form a group where only C=1C = 1 stays constant, giving CC.
  • The pair in row A=1A=1, columns 1111 and 1010, gives ABAB.

That again yields F=C+ABF = C + AB. Rules: groups must be rectangles of size 1, 2, 4 or 8; make them as large as possible; overlapping is allowed; the map wraps around at the edges.

Don’t-care conditions

If some input combinations can never occur, mark them X. You may include them in a group if that makes the group larger, and otherwise ignore them. The calculator above accepts don’t-cares separately from the minterms.

For more than four variables

Karnaugh maps become unwieldy beyond four or five variables. The Quine–McCluskey method does the same merging systematically: list the minterms, repeatedly combine pairs that differ in one bit to find the prime implicants, then choose a minimal set that covers every minterm. This is what the calculator does.

Common mistakes

  • Complementing the wrong way. A 0 in the row means the variable appears complemented in the minterm.
  • Missing the wrap-around in a K-map: the first and last columns are adjacent.
  • Stopping at non-maximal groups, which leaves extra literals.
  • Confusing SOP with POS. For a product of sums, use the rows where F=0F = 0, and write each maxterm as an OR with the opposite complement rule.

References

  1. Mano, M. M. & Ciletti, M. D. (2018). Digital Design (6th ed.), Chapters 2–3. Pearson.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.