Truth Tables and Normal Forms
Truth Tables
A truth table exhaustively lists every possible combination of input values and the corresponding output of a Boolean function. For a function of variables, the truth table has rows. The rows are conventionally listed in binary counting order (0 to ), though other orderings (e.g., Gray code) are sometimes used for specific purposes.
Example: The function has the following truth table:
| x | y | z | ||
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Minterms
A minterm of Boolean variables is a product (AND) term that includes every variable exactly once, in either complemented or uncomplemented form. For variables there are possible minterms.
Notation: denotes the minterm corresponding to row of the truth table. For a function of 3 variables (, , ), with as the most significant bit:
| i | x | y | z | Minterm |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | |
| 1 | 0 | 0 | 1 | |
| 2 | 0 | 1 | 0 | |
| 3 | 0 | 1 | 1 | |
| 4 | 1 | 0 | 0 | |
| 5 | 1 | 0 | 1 | |
| 6 | 1 | 1 | 0 | |
| 7 | 1 | 1 | 1 |
A minterm is TRUE (equals 1) for exactly one input combination: the combination corresponding to row . Note that is NOT a minterm for a 3-variable function because it omits ; it is simply a product term.
Disjunctive Normal Form (DNF)
The Disjunctive Normal Form (DNF), also called Sum of Products (SOP) form, expresses a Boolean function as the OR (sum, disjunction) of its minterms. Specifically:
Using notation for brevity: means the OR of minterms , , , , .
For the example function above, the rows where are 3, 4, 5, 6, 7. The DNF is:
DNF has the property that it is canonical: every Boolean function has exactly one DNF representation (up to reordering of minterms). This uniqueness makes DNF useful for comparing functions.
Note on terminology: The term “Sum of Products” (SOP) is often used more broadly to describe any expression that is an OR of AND terms, even if those AND terms are not minterms. For example, is in SOP form but is NOT in DNF because the terms and are not minterms (they omit some variables). When we want to be precise, DNF refers specifically to the OR-of-minterms form.
Maxterms
A maxterm of Boolean variables is a sum (OR) term that includes every variable exactly once, in either complemented or uncomplemented form.
Notation: denotes the maxterm corresponding to row . The rule for constructing maxterms from the truth table: for row , if the variable is 0, use the uncomplemented form; if the variable is 1, use the complemented form. (This is the opposite of the minterm rule.)
For 3 variables:
| i | x | y | z | Maxterm |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | |
| 1 | 0 | 0 | 1 | |
| 2 | 0 | 1 | 0 | |
| 3 | 0 | 1 | 1 | |
| 4 | 1 | 0 | 0 | |
| 5 | 1 | 0 | 1 | |
| 6 | 1 | 1 | 0 | |
| 7 | 1 | 1 | 1 |
A maxterm is FALSE (equals 0) for exactly one input combination (row ) and is TRUE for all others.
Conjunctive Normal Form (CNF)
The Conjunctive Normal Form (CNF), also called Product of Sums (POS) form, expresses a Boolean function as the AND (product, conjunction) of its maxterms:
Using notation: means the AND of maxterms , , .
For the example function , the rows where are 0, 1, 2. The CNF is:
CNF is also canonical: every Boolean function has a unique CNF representation.
Relationship Between DNF and CNF
The maxterm is the complement of the minterm , and vice versa:
This can be verified: the minterm is TRUE only for row 3; its complement is FALSE only for row 3, which is exactly the behaviour of maxterm . Indeed, by De Morgan: .
The DNF and CNF of the same function are related by:
Worked Example: Deriving DNF and CNF for
This is a 4-variable function . We will build its full truth table and derive both normal forms.
Step 1: Build the Truth Table
For 4 variables there are rows. We list , , , in counting order and evaluate the three terms and their OR.
| Row | a | b | c | d | ||||
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 2 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
| 3 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 |
| 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 5 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
| 6 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 7 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
| 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 9 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 10 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
| 11 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
| 12 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 13 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 14 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 15 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Step 2: DNF from rows
Rows where : 1, 2, 3, 5, 7, 10, 11.
Writing the minterms (using as MSB, as LSB):
So the DNF is:
Or in compact notation: .
Step 3: CNF from rows
Rows where : 0, 4, 6, 8, 9, 12, 13, 14, 15.
Writing the maxterms:
For each row, variables that are 0 appear uncomplemented; variables that are 1 appear complemented.
| Row | a | b | c | d | Maxterm |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | |
| 4 | 0 | 1 | 0 | 0 | |
| 6 | 0 | 1 | 1 | 0 | |
| 8 | 1 | 0 | 0 | 0 | |
| 9 | 1 | 0 | 0 | 1 | |
| 12 | 1 | 1 | 0 | 0 | |
| 13 | 1 | 1 | 0 | 1 | |
| 14 | 1 | 1 | 1 | 0 | |
| 15 | 1 | 1 | 1 | 1 |
So the CNF is:
Or in compact notation: .
Observation
The DNF has 7 minterms and the CNF has 9 maxterms. Neither is simplified; both are canonical and unique. The function has more zeros than ones, so DNF is more compact in this case. For implementation, we would simplify from either form (see Karnaugh Maps).
Non-Canonical SOP and POS
In practice we rarely use the full DNF/CNF for implementation because they are not simplified. Instead we use:
- SOP (Sum of Products): any OR of AND terms, not necessarily minterms. E.g., is SOP but not DNF.
- POS (Product of Sums): any AND of OR terms, not necessarily maxterms.
The minimisation techniques covered in the following notes take the canonical forms and produce simplified SOP or POS expressions.
Summary
| Property | DNF (SOP of minterms) | CNF (POS of maxterms) |
|---|---|---|
| Form | OR of ANDs | AND of ORs |
| Terms are | Minterms (all vars, ANDed) | Maxterms (all vars, ORed) |
| Canonical? | Yes (unique) | Yes (unique) |
| Constructed from rows where | ||
| Compact notation | ||
| Minimised? | No | No |