CleverSphere

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. 1 · DNF & CNF
  2. 2
  3. 3

Give the canonical DNF and the canonical CNF of this function.

A B CF
0 0 01
0 0 11
0 1 01
0 1 10
1 0 00
1 0 10
1 1 01
1 1 10

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 CF
0 0 00
0 0 11
0 1 01
0 1 11
1 0 00
1 0 11
1 1 00
1 1 11

Worked solution

  1. 1DNF: one minterm per row with F = 1 (0 is negated): rows 001, 010, 011, 101, 111.
  2. 2F = (¬A ∧ ¬B ∧ C) ∨ (¬A ∧ B ∧ ¬C) ∨ (¬A ∧ B ∧ C) ∨ (A ∧ ¬B ∧ C) ∨ (A ∧ B ∧ C)
  3. 3CNF: one maxterm per row with F = 0 (1 is negated): rows 000, 100, 110.
  4. 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.

Related

More topics