DNF and CNF from a truth table
Every Boolean function can be written as a DNF (OR of minterms) and as a CNF (AND of maxterms). You read both straight off the truth table.
Rules
- DNF: one minterm per row with F = 1
- In a minterm: 1 → variable, 0 → negated variable
- CNF: one maxterm per row with F = 0
- In a maxterm: 0 → variable, 1 → negated variable
- Canonical: every term contains all variables
Your turn
Three problems on this topic. Any equivalent formula counts.
- 1 · DNF & CNF
- 2
- 3
Give the canonical DNF and the canonical CNF of this function.
| A B C | F |
|---|---|
| 0 0 0 | 1 |
| 0 0 1 | 1 |
| 0 1 0 | 1 |
| 0 1 1 | 0 |
| 1 0 0 | 0 |
| 1 0 1 | 0 |
| 1 1 0 | 1 |
| 1 1 1 | 0 |
Canonical DNF
Canonical CNF
Type formulas like A'B + C, ¬A ∧ B or !A & B. Any equivalent way of writing it counts. The symbol buttons insert a character.
Worked example
Give the canonical DNF and the canonical CNF of this function.
| A B C | F |
|---|---|
| 0 0 0 | 0 |
| 0 0 1 | 1 |
| 0 1 0 | 1 |
| 0 1 1 | 1 |
| 1 0 0 | 0 |
| 1 0 1 | 1 |
| 1 1 0 | 0 |
| 1 1 1 | 1 |
Worked solution
- 1DNF: one minterm per row with F = 1 (0 is negated): rows 001, 010, 011, 101, 111.
- 2F = (¬A ∧ ¬B ∧ C) ∨ (¬A ∧ B ∧ ¬C) ∨ (¬A ∧ B ∧ C) ∨ (A ∧ ¬B ∧ C) ∨ (A ∧ B ∧ C)
- 3CNF: one maxterm per row with F = 0 (1 is negated): rows 000, 100, 110.
- 4F = (A ∨ B ∨ C) ∧ (¬A ∨ B ∨ C) ∧ (¬A ∨ ¬B ∨ C)
Typical mistake: In the CNF the negation is reversed: a 1 in the row means the variable is negated.
Common questions
When do I use DNF and when CNF?
Both are always correct. In practice pick the one with fewer terms: DNF with few ones, CNF with few zeros.
