Digital · Boolean algebra · 7 min

From Truth Table to Boolean Expression: SOP, POS and Minimization

A truth table fully defines a Boolean function, so you can read an algebraic expression straight off it — two complementary ways. Take the 1-rows and you get the sum of products (SOP); take the 0-rows and you get the product of sums (POS). Both describe the same F. This guide works one running 3-variable example through both methods, defines minterm/maxterm notation, and shows why the canonical form you read off is correct but usually not minimal. Build or check any table in the Logic Gate Truth Table Generator.

The idea & the example

A truth table lists the output of a function for every possible input combination, so it leaves nothing undefined — it is the function. Because of that, you can extract an algebraic formula directly: each row of the table contributes one term, and you simply decide whether to collect the rows that output 1 (giving an SOP) or the rows that output 0 (giving a POS). We will do both on one fixed function so the two forms can be compared side by side. Here is the running example F(A,B,C) — the index column 0–7 is just the binary value of ABC:

RowABCF
0000 0
1001 1
2010 0
3011 1
4100 0
5101 0
6110 1
7111 1

⚠️ F is 1 on rows 001, 011, 110, 111 (indices 1, 3, 6, 7) and 0 on rows 000, 010, 100, 101 (indices 0, 2, 4, 5). Hold those two sets in mind — SOP uses the first, POS uses the second.

Sum of products — from the rows where F = 1

Look only at the rows where the output is 1. Each one becomes a minterm: an AND of all three variables, where a variable is complemented if its value in that row is 0 and left uncomplemented if it is 1. Reading off our four 1-rows:

MintermABCProduct term
m1001A'B'C
m3011A'BC
m6110ABC'
m7111ABC

OR the four minterms together and you have the canonical SOP:

F = A'B'C + A'BC + ABC' + ABC = Σm(1,3,6,7)

Canonical does not mean minimal. One round of Boolean algebra shrinks it: the first two terms share A'C and differ only in B, so A'B'C + A'BC = A'C(B' + B) = A'C — the B drops out. The last two share AB, so ABC' + ABC = AB(C' + C) = AB. That leaves:

F = A'C + AB

You can verify this against the table by hand — it must reproduce all eight rows. (For A'C, A'C = 1 exactly on rows 1 and 3; for AB, AB = 1 exactly on rows 6 and 7; everywhere else both are 0 — which matches the output column above.) The Boolean Algebra Simplifier confirms the algebra in one step, and the Logic Gate Truth Table Generator rebuilds the table from either expression so you can check the 1-rows line up.

Product of sums — from the rows where F = 0

Now look only at the rows where the output is 0. Each becomes a maxterm: an OR of all three variables, with the opposite complement rule — a variable is complemented if its value in that row is 1, left uncomplemented if it is 0. Reading off our four 0-rows:

MaxtermABCSum term
M0000A+B+C
M2010A+B'+C
M4100A'+B+C
M5101A'+B+C'

AND the four maxterms together and you have the canonical POS:

F = (A+B+C)(A+B'+C)(A'+B+C)(A'+B+C') = ΠM(0,2,4,5)

This is the same function as the SOP above — it just describes the half of the table where F is 0, where SOP describes the half where it is 1. SOP is usually handier for AND-then-OR logic; POS is the natural fit for OR-then-AND and NOR-heavy logic. The Boolean Algebra Simplifier accepts both forms if you want to confirm they agree.

Σm and ΠM notation

The shorthand just lists which rows feed each form. Σm(...) is the OR of the listed minterms — the rows where F = 1. ΠM(...) is the AND of the listed maxterms — the rows where F = 0. Because every row is either a 1 or a 0, the two index lists partition the range 0 … 2n−1: an index in the Σm list is exactly an index not in the ΠM list.

For our example, Σm(1,3,6,7) and ΠM(0,2,4,5). Their union is {0,1,2,3,4,5,6,7} — every row 0–7 — and they share no element, so they are complementary sets. That partition is the formal reason SOP and POS always describe the identical function.

Minimizing the result

The canonical SOP had four product terms; after one algebra step it collapsed to F = A'C + AB — two terms, far fewer gates. You can grind through the algebra by hand as shown, but it is error-prone past three variables. The reliable visual method is the Karnaugh map: plot the 1s, circle the largest power-of-two groups, and read off the minimal SOP directly. The sibling walkthrough Karnaugh map tutorial covers the grouping rules step by step, and the Karnaugh Map Solver does the grouping for you. Use the Boolean Algebra Simplifier to verify the algebra and the Logic Gate Truth Table Generator to confirm the minimized expression still reproduces the original table.

SOP or POS — which?

A quick judgment rule: choose SOP when most outputs are 0, because few 1-rows means few product terms; choose POS when most outputs are 1, because few 0-rows means few sum terms. When in doubt, write both and keep whichever has fewer terms — that is usually the cheaper circuit.

Honest boundary: canonical SOP and POS are always correct, but they are rarely minimal. A four-minterm form may reduce to two terms (as ours did). Always minimize — by algebra or with the Karnaugh Map Solver — before you commit the logic to hardware, or you will pay for gates you do not need.

FAQ

How do I get a Boolean expression from a truth table?
Read it straight off the output column two complementary ways. For sum-of-products (SOP) you look at every row where the output is 1 and write one minterm — an AND of all the variables — for each, then OR those terms together. For product-of-sums (POS) you look at every row where the output is 0 and write one maxterm — an OR of all the variables — then AND those together. Both forms describe the identical function, so you can pick whichever is shorter. The Logic Gate Truth Table Generator builds the table for you and the Boolean Algebra Simplifier checks the expression you read off.
What is the difference between SOP and POS?
SOP (sum of products) is an OR of AND terms and is built from the rows where the output is 1, using minterms. POS (product of sums) is an AND of OR terms and is built from the rows where the output is 0, using maxterms. They are duals of each other and always describe the same function, just written from opposite halves of the table. SOP maps directly onto AND-then-OR gate logic while POS maps onto OR-then-AND (and NOR-heavy) logic, so the better choice depends on your target gates and on which form has fewer terms. The Boolean Algebra Simplifier accepts either form.
What are minterms and maxterms?
A minterm is the AND of all the variables for one specific 1-row, where each variable is complemented if its value in that row is 0 and left as-is if it is 1 — so it is true for exactly that one input combination. A maxterm is the OR of all the variables for one specific 0-row, using the opposite rule: complement a variable if its value is 1, leave it if it is 0 — so it is false for exactly that one combination. The minterm indices (the rows that are 1) and the maxterm indices (the rows that are 0) form complementary sets that together cover every row from 0 to 2^n−1. You can confirm any single term in the Logic Gate Truth Table Generator by checking which row it isolates.
Should I use SOP or POS?
Pick whichever yields fewer terms, because fewer terms means fewer gates. SOP is shorter when the function has few 1-rows (few minterms), and POS is shorter when it has few 0-rows (few maxterms). A practical rule: if most of the output column is 0 use SOP, and if most of it is 1 use POS. Remember that the canonical form you read off the table is correct but rarely minimal, so always minimize — with Boolean algebra or the Karnaugh Map Solver — before committing the design to hardware.
⚡ Powered by Circflow