Sum-of-Products & Product-of-Sums

Digital Logic 101 · 10 min read

From a truth table to canonical SOP

#ABCFminterm
00001A'B'C'
10010
20100
30111A'BC
41000
51011AB'C
61100
71111ABC
F = A′B′C′ + A′BC + AB′C + ABC
Figure 1. Each truth-table row where F=1 contributes one minterm. A minterm is an n-literal product that is true only on its row. OR all of them together and you get the canonical sum-of-products.

A minterm for n variables is an AND of every variable, each either bare or primed. With n variables there are exactly 2n2^n minterms — one per row of the truth table.

The minterm for row ii evaluates to 1 only on row i. Take the OR of every minterm whose row has F=1F=1 and you get a sum-of-products that matches the truth table exactly. That’s the canonical SOP.

Read the truth table top-to-bottom. For every F=1F=1 row, write the literal: variable bare when the bit is 1, primed when the bit is 0. AND them together, then OR the rows.

From a truth table to canonical POS

#ABCFmaxterm
00001
10010A+B+C'
20100A+B'+C
30111
41000A'+B+C
51011
61100A'+B'+C
71111
F = (A+B+C′)(A+B′+C)(A′+B+C)(A′+B′+C)
Figure 2. Each row where F=0 contributes one maxterm. A maxterm is an n-literal sum that is false only on its row. AND all of them together and you get the canonical product-of-sums.

A maxterm is the dual of a minterm: an OR of every variable (bare or primed) that is 0 only on its row. The literal sense flips: for the row where bit jj is 1, the variable is primed; for bit 0, the variable is bare.

AND all maxterms whose rows have F=0F=0 and you get the canonical POS — the product-of-sums that matches the truth table exactly.

Σm and ΠM compact notation

F = Σm(0, 3, 5, 7)

F = ΠM(1, 2, 4, 6)

\{0,3,5,7\} ∪ \{1,2,4,6\} = \{0..7\}, disjoint.

0
1
2
3
4
5
6
7

accent = minterm row (F=1); plain = maxterm row (F=0).

Figure 3. Σm lists the rows where F=1; ΠM lists the rows where F=0. The two index sets are complementary — together they enumerate all 2^n rows.

Writing every literal gets verbose. Engineers compress it: F=m(0,3,5,7)F = \sum m(0, 3, 5, 7) means “the OR of minterms 0, 3, 5, and 7”. The dual form F=M(1,2,4,6)F = \prod M(1, 2, 4, 6) means “the AND of maxterms 1, 2, 4, and 6”.

For a single function the two index sets are complements — the minterm indices are exactly the rows missing from the maxterm indices.

Non-canonical SOP and POS

Canonical forms are exhaustive but not minimal. Once you have a canonical SOP, simplification (Boolean algebra, K-maps, Quine-McCluskey) reduces it to a non-canonical SOP whose product terms have fewer literals. The function is the same; the gate count drops.

Don’t-cares

#ABF
0001
101X
2100
3111

F = Σm(0, 3) + d(1)

F = ΠM(2) · D(1)

Row 1 is unobserved → minimiser may treat its F-value as 0 or 1 depending on which yields a smaller cover.

Figure 4. Don't-care rows can be assigned 0 or 1 freely — pick whichever value yields the smaller minimised expression. They appear as d(...) inside Σm and D(...) inside ΠM.

A don’t-care row is one whose input combination can’t occur (BCD codes 10-15, for example) or whose output doesn’t matter to the larger system. Mark it “X” on the truth table. The minimiser is then free to absorb it as 0 or 1, whichever shrinks the result.

Notation: F=m(0,3)+d(1)F = \sum m(0, 3) + d(1) for SOP, F=M(2)D(1)F = \prod M(2) \cdot D(1) for POS. Don’t-cares are not required in the minimum form — they’re available for use.

The Simulate stage lets you click each row's F-cell to cycle 0 → 1 → X. Watch how the Σm and ΠM expressions update as you flip individual rows.