Sub topic 5
Canonical Forms: Minterms and Maxterms
Assume you know binary number conversion, basic logic gates, and Boolean notation. This chapter uses the variable order \(A,B,C\), with \(A\) as the most significant bit.
Canonical forms represent a Boolean function directly from its truth table. There are two standard forms:
- Sum of minterms, also called canonical SOP: OR of AND terms.
- Product of maxterms, also called canonical POS: AND of OR terms.
Minterms and sum of minterms
A minterm is an AND term containing every variable exactly once. It is 1 for exactly one input row and 0 for every other row.
For a row with input \(A=0,B=1,C=0\), the minterm is:
\[ A'BC' \]
A variable is complemented when its row value is 0 and uncomplemented when its row value is 1.
For variables \(A,B,C\), the minterm index is the binary value \(ABC\):
| Input \(ABC\) | Decimal index | Minterm |
|---|---|---|
| 000 | 0 | \(A'B'C'\) |
| 010 | 2 | \(A'BC'\) |
| 111 | 7 | \(ABC\) |
If a function is 1 on rows 1, 2, and 7, its canonical sum-of-products form is:
\[ F(A,B,C)=A'B'C+A'BC'+ABC \]
The compact notation is:
\[ F(A,B,C)=\Sigma m(1,2,7) \]
The symbol \(\Sigma m\) means “sum of the listed minterms.” The notation lists the row indices where the function is 1.
Maxterms and product of maxterms
A maxterm is an OR term containing every variable exactly once. It is 0 for exactly one input row and 1 for every other row.
For a row with input \(A=0,B=1,C=0\), the maxterm is:
\[ A+B'+C \]
The rule is opposite to the minterm rule:
- Use an uncomplemented variable when the row value is 0.
- Use a complemented variable when the row value is 1.
For the same variables:
| Input \(ABC\) | Decimal index | Maxterm |
|---|---|---|
| 000 | 0 | \(A+B+C\) |
| 010 | 2 | \(A+B'+C\) |
| 111 | 7 | \(A'+B'+C'\) |
If \(F\) is 0 on rows 0, 3, and 6, its canonical product-of-sums form is:
\[ F(A,B,C)=(A+B+C)(A+B'+C')(A'+B+C) \]
The compact notation is:
\[ F(A,B,C)=\Pi M(0,3,6) \]
The symbol \(\Pi M\) means “product of the listed maxterms.” The listed indices are the rows where the function is 0.
Converting between the two forms
If a function has variables \(A,B,C\), all possible row indices are 0 through 7. Therefore:
\[ \Sigma m(1,2,7)=\Pi M(0,3,4,5,6) \]
The minterm indices and maxterm indices are complementary sets.
from itertools import product
def canonical_forms():
ones = []
zeros = []
for index, (a, b, c) in enumerate(product([0, 1], repeat=3)):
value = (not a and b and not c) or (a and b and c)
(ones if value else zeros).append(index)
print("Σm(" + ",".join(map(str, ones)) + ")")
print("ΠM(" + ",".join(map(str, zeros)) + ")")
canonical_forms()Exercise
Write the canonical SOP and POS forms for a function of \(A,B,C\) that is 1 on rows 1, 4, 5, and 7.
Show answer
\(F=\Sigma m(1,4,5,7)=A'B'C+AB'C'+AB'C+ABC\). The zero rows are 0, 2, 3, and 6, so \(F=\Pi M(0,2,3,6)\).