Sum of products and product of sums
Type an expression and get its minterms, maxterms, and all four standard forms: canonical and minimal, SOP and POS. Everything is worked out in your browser.
Reading it as a ∧ ¬b ∨ a ∧ b ∧ c ∨ ¬a ∧ ¬b ∧ c
| # | a | b | c | Q | Term |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | maxterm M0 |
| 1 | 0 | 0 | 1 | 1 | minterm m1 |
| 2 | 0 | 1 | 0 | 0 | maxterm M2 |
| 3 | 0 | 1 | 1 | 0 | maxterm M3 |
| 4 | 1 | 0 | 0 | 1 | minterm m4 |
| 5 | 1 | 0 | 1 | 1 | minterm m5 |
| 6 | 1 | 1 | 0 | 0 | maxterm M6 |
| 7 | 1 | 1 | 1 | 1 | minterm m7 |
Minterms and maxterms
Both are ways of naming a single row of the truth table. Which one you use depends on whether you are describing where the function is true or where it is false.
| Minterm | Maxterm | |
|---|---|---|
| Marks a row where | the output is 1 | the output is 0 |
| Written as | an AND of every variable | an OR of every variable |
| A 1 in the row means | a | ¬a |
| A 0 in the row means | ¬a | a |
| Combined with | OR, giving a sum of products | AND, giving a product of sums |
| Notation | Σm(…) | ΠM(…) |
The polarities really do flip: minterm 2 of three variables is ¬a ∧ b ∧ ¬c, while maxterm 2 is a ∨ ¬b ∨ c. One says "the output is 1 exactly here", the other says "the output is 0 exactly here", so each rules out or pins down the same single row.
Canonical, then minimal
Canonical form comes straight off the truth table with no thinking involved, which is what makes it useful and also what makes it long. Minimising is what turns it into a circuit worth building.
- Read the rows. Every row where the output is 1 becomes one minterm, and ORing them together gives canonical SOP. It is guaranteed correct and almost always bigger than it needs to be.
- Merge the neighbours. Two terms differing in one variable collapse into one, by the adjacency law. Repeating that until nothing merges is the first half of Quine-McCluskey — the second half picks which of the groups it found to keep — and it is what circling groups on a Karnaugh map does by eye.
- Try it from the other side. The minimal POS is found by minimising the rows where the output is 0 and then complementing. For some functions it comes out smaller than the SOP, which is why both are shown above.
- Build it. Paste either form into the simulator with ctrl+E and compare the gate counts for yourself.
Questions
What is the difference between a minterm and a maxterm?
A minterm is one row of the truth table where the output is 1, written as an AND of every variable. A maxterm is a row where the output is 0, written as an OR of every variable with the polarities flipped. Every function is the OR of its minterms, and equally the AND of its maxterms, the two constant functions aside, where one of the two lists is empty.
What do Σm and ΠM mean?
They are shorthand for listing row numbers. Σm(1, 3, 5) means the sum, that is the OR, of minterms 1, 3 and 5. ΠM(0, 2, 4) means the product, that is the AND, of maxterms 0, 2 and 4. The two lists are complements of each other: every row is in exactly one of them.
What is the difference between canonical and minimal form?
Canonical form writes every variable in every term, so it maps one to one onto the truth table but is long. Minimal form is the same function with the redundancy removed by Quine-McCluskey, so it needs fewer gates. Both describe exactly the same behaviour.
Should I use sum of products or product of sums?
Whichever is smaller for your function, which usually means SOP when the output is mostly 0 and POS when it is mostly 1. Both are shown above so you can compare term counts. SOP maps directly onto AND gates feeding an OR, and POS onto OR gates feeding an AND.