Sub topic 3
Minterms, maxterms and canonical forms
This chapter assumes you know binary and hexadecimal numbers, the AND, OR and NOT operations, and the basic Boolean laws from the previous chapter (identity, De Morgan's theorem, duality). It builds the standard ways to write a Boolean function so you can compare, convert and implement functions. These forms feed directly into Karnaugh maps, multiplexers and decoders in later chapters.
Why a canonical form exists
The same function can be written in many algebraic ways. For example, A + AB and A are the same function. To compare two expressions, or to hand a function to a mapping or implementation method, you need one form that is unique. A canonical form is a unique expression for a function: every product or sum term contains every variable, either complemented or uncomplemented.
There are two canonical forms:
- Canonical SOP (sum of products): an OR of minterms.
- Canonical POS (product of sums): an AND of maxterms.
Minterms
A literal is a variable or its complement, such as A or A'. A minterm of n variables is an AND of n literals, with each variable appearing exactly once. A minterm is 1 for exactly one input combination and 0 for all others.
To name a minterm, read the input row as a binary number. A variable that is 1 appears uncomplemented. A variable that is 0 appears complemented. For three variables A, B, C (A is the most significant bit):
| Row | A B C | Minterm | Maxterm |
|---|---|---|---|
| 0 | 0 0 0 | m0 = A'B'C' | M0 = A + B + C |
| 1 | 0 0 1 | m1 = A'B'C | M1 = A + B + C' |
| 2 | 0 1 0 | m2 = A'BC' | M2 = A + B' + C |
| 3 | 0 1 1 | m3 = A'BC | M3 = A + B' + C' |
| 4 | 1 0 0 | m4 = AB'C' | M4 = A' + B + C |
| 5 | 1 0 1 | m5 = AB'C | M5 = A' + B + C' |
| 6 | 1 1 0 | m6 = ABC' | M6 = A' + B' + C |
| 7 | 1 1 1 | m7 = ABC | M7 = A' + B' + C' |
Maxterms
A maxterm of n variables is an OR of n literals, with each variable appearing exactly once. A maxterm is 0 for exactly one input combination and 1 for all others.
The naming rule is the opposite of the minterm rule. A variable that is 0 appears uncomplemented. A variable that is 1 appears complemented. So M5 (input 101) is A' + B + C': it is 0 only when A=1, B=0, C=1.
Two relations connect the two kinds of term:
Mi = (mi)', so each maxterm is the complement of the minterm with the same index.mi = (Mi)', which follows from the first by De Morgan's theorem.
Reading the forms from a truth table
Take a function F(A, B, C) defined by this truth table:
| A B C | F |
|---|---|
| 0 0 0 | 0 |
| 0 0 1 | 1 |
| 0 1 0 | 0 |
| 0 1 1 | 1 |
| 1 0 0 | 0 |
| 1 0 1 | 0 |
| 1 1 0 | 1 |
| 1 1 1 | 1 |
Canonical SOP. OR together the minterms of the rows where F = 1. These are rows 1, 3, 6 and 7:
F = m1 + m3 + m6 + m7 = Σm(1, 3, 6, 7)
Written out: F = A'B'C + A'BC + ABC' + ABC.
Canonical POS. AND together the maxterms of the rows where F = 0. These are rows 0, 2, 4 and 5:
F = M0 · M2 · M4 · M5 = ΠM(0, 2, 4, 5)
Written out: F = (A + B + C)(A + B' + C)(A' + B + C)(A' + B + C').
The two lists are complementary. The indices in Σm and ΠM together cover 0 to 2^n − 1 with no overlap. So if you know one list, the other is every remaining index.
Converting between the forms
There are two common conversions.
- Σm to ΠM. List the indices from 0 to 2^n − 1 that are missing from the Σm list. Those are the ΠM indices. For F above, the missing indices from {1, 3, 6, 7} are {0, 2, 4, 5}.
- Complement of a function.
F' = Σm(indices where F is 0) = ΠM(indices where F is 1). SoF' = Σm(0, 2, 4, 5)andF' = ΠM(1, 3, 6, 7).
The count of terms must always add up to 2^n. A function of 3 variables has 8 rows, so |Σm| + |ΠM| = 8.
Expanding a non-canonical expression
A function is often given in a reduced form where some variables are missing from a term. To make it canonical, add the missing variables using two identities: X = X(Y + Y') for SOP, and X = X + YY' for POS.
Expand F(A, B, C) = A + B'C into canonical SOP:
- Term
Ais missing B and C:A = A(B + B')(C + C') = ABC + ABC' + AB'C + AB'C'. These are m7, m6, m5, m4. - Term
B'Cis missing A:B'C = (A + A')B'C = AB'C + A'B'C. These are m5 and m1. - Combine. The term m5 appears twice, and
X + X = X, so keep it once.
F = Σm(1, 4, 5, 6, 7)
The equivalent POS form takes the missing indices: F = ΠM(0, 2, 3).
Expand into POS directly: F = (A + B)(A + C')? Check by distribution: A + B'C = (A + B')(A + C). Apply X = X + YY' to each factor. (A + B') becomes (A + B' + C)(A + B' + C') = M2 · M3. (A + C) becomes (A + B + C)(A + B' + C) = M0 · M2. The product is M0 · M2 · M3, which matches ΠM(0, 2, 3).
Don't-care conditions
Some input combinations never occur, or the output for them does not matter. These are don't-cares, written d. In index notation, F = Σm(1, 4) + Σd(6, 7). You may treat each don't-care as 0 or 1, whichever gives the simpler circuit. A canonical form is only unique once you fix what each don't-care means. Don't-cares matter most in Karnaugh maps, covered in the next chapter.
Counting functions
With n variables there are 2^n rows. Each row's output can be 0 or 1 independently. So the number of distinct functions is 2^(2^n).
| Variables n | Rows 2^n | Distinct functions 2^(2^n) |
|---|---|---|
| 1 | 2 | 4 |
| 2 | 4 | 16 |
| 3 | 8 | 256 |
| 4 | 16 | 65,536 |
This count is a common GATE question. A related one: a function with k minterms, written as Σm, has 2^n − k maxterms in its ΠM form.
Checking a canonical form in code
You can verify a Σm list by evaluating the function over all inputs. This Python program builds the minterm and maxterm index lists for the function F = A + B'C from the worked example.
from itertools import product
def f(a, b, c):
return a | ((1 - b) & c)
minterms = []
maxterms = []
for index, (a, b, c) in enumerate(product([0, 1], repeat=3)):
if f(a, b, c):
minterms.append(index)
else:
maxterms.append(index)
print("Sum of minterms:", minterms)
print("Product of maxterms:", maxterms)The output is Sum of minterms: [1, 4, 5, 6, 7] and Product of maxterms: [0, 2, 3]. product([0, 1], repeat=3) lists rows in binary counting order, so the loop index equals the row number, with A as the most significant bit.
Common errors
- Reversing the maxterm rule. In a maxterm, 0 becomes the plain variable and 1 becomes the complemented variable. Writing M5 as
A + B' + Cis wrong. The correct form isA' + B + C'. - Mixing up bit order. Index 1 for variables (A, B, C) means A=0, B=0, C=1. If the problem lists variables in a different order, the same row number refers to a different input.
- Forgetting that canonical forms are not minimal.
Σm(4, 5, 6, 7)isA. The canonical form has four terms, but the function needs no gates. - Dropping a duplicate term incorrectly. After expansion,
X + X = Xfor SOP andX · X = Xfor POS. Keep each index once. - Applying the wrong complement rule.
F'keeps the same index set but switches Σm to ΠM, or it complements the index set while keeping the form. Both statements are the same fact; do not do both at once.
Why this matters for later chapters
A Karnaugh map is a truth table arranged so that adjacent minterms differ in one variable. A decoder produces every minterm of its inputs, so ORing the right outputs implements any Σm. A multiplexer with n select lines can realize any function of n variables by tying data inputs to the truth-table values. Each of these methods starts from the minterm list.
Exercise
A function G(A, B, C, D) equals 1 for minterms 0, 2, 5, 7, 8, 10, 13 and 15, and 0 otherwise. (a) Write G in ΠM form. (b) How many maxterms does the ΠM form of G' have?
Show answer
(a) There are 16 rows. The missing indices from {0, 2, 5, 7, 8, 10, 13, 15} are {1, 3, 4, 6, 9, 11, 12, 14}, so G = ΠM(1, 3, 4, 6, 9, 11, 12, 14). (b) G' is 1 where G is 0, so G' = Σm(1, 3, 4, 6, 9, 11, 12, 14). The ΠM form of G' uses the rows where G' is 0, which are the 8 rows where G is 1: ΠM(0, 2, 5, 7, 8, 10, 13, 15). The answer is 8.
Exercise
Express F(A, B, C) = (A + B)(B' + C) as a sum of minterms.
Show answer
Expand: (A + B)(B' + C) = AB' + AC + BB' + BC = AB' + AC + BC. Add missing variables. AB' = AB'C + AB'C' = m5 + m4. AC = ABC + AB'C = m7 + m5. BC = ABC + A'BC = m7 + m3. Combine and drop duplicates: F = Σm(3, 4, 5, 7).
Exercise
How many distinct Boolean functions of 4 variables have exactly 3 minterms?
Show answer
A function is fixed by choosing which rows are 1. Choose 3 of the 16 rows: C(16, 3) = 560 functions.