Skip to content
Part IA Michaelmas Term

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 nn variables, the truth table has 2n2^n rows. The rows are conventionally listed in binary counting order (0 to 2n12^n - 1), though other orderings (e.g., Gray code) are sometimes used for specific purposes.

Example: The function f(x,y,z)=x+yzf(x, y, z) = x + y \cdot z has the following truth table:

xyzyzy \cdot zf=x+yzf = x + y \cdot z
00000
00100
01000
01111
10001
10101
11001
11111

Minterms

A minterm of nn Boolean variables is a product (AND) term that includes every variable exactly once, in either complemented or uncomplemented form. For nn variables there are 2n2^n possible minterms.

Notation: mim_i denotes the minterm corresponding to row ii of the truth table. For a function of 3 variables (xx, yy, zz), with xx as the most significant bit:

ixyzMinterm mim_i
0000xˉyˉzˉ\bar{x} \cdot \bar{y} \cdot \bar{z}
1001xˉyˉz\bar{x} \cdot \bar{y} \cdot z
2010xˉyzˉ\bar{x} \cdot y \cdot \bar{z}
3011xˉyz\bar{x} \cdot y \cdot z
4100xyˉzˉx \cdot \bar{y} \cdot \bar{z}
5101xyˉzx \cdot \bar{y} \cdot z
6110xyzˉx \cdot y \cdot \bar{z}
7111xyzx \cdot y \cdot z

A minterm mim_i is TRUE (equals 1) for exactly one input combination: the combination corresponding to row ii. Note that yzy \cdot z is NOT a minterm for a 3-variable function because it omits xx; 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:

f=mifor all i where f=1f = \sum m_i \quad \text{for all } i \text{ where } f = 1

Using Σ\Sigma notation for brevity: f=Σ(3,4,5,6,7)f = \Sigma(3, 4, 5, 6, 7) means the OR of minterms m3m_3, m4m_4, m5m_5, m6m_6, m7m_7.

For the example function f=x+yzf = x + y \cdot z above, the rows where f=1f = 1 are 3, 4, 5, 6, 7. The DNF is:

f=xˉyz+xyˉzˉ+xyˉz+xyzˉ+xyzf = \bar{x} \cdot y \cdot z + x \cdot \bar{y} \cdot \bar{z} + x \cdot \bar{y} \cdot z + x \cdot y \cdot \bar{z} + x \cdot y \cdot z

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, f=x+yzf = x + y \cdot z is in SOP form but is NOT in DNF because the terms xx and yzy \cdot z 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 nn Boolean variables is a sum (OR) term that includes every variable exactly once, in either complemented or uncomplemented form.

Notation: MiM_i denotes the maxterm corresponding to row ii. The rule for constructing maxterms from the truth table: for row ii, 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:

ixyzMaxterm MiM_i
0000x+y+zx + y + z
1001x+y+zˉx + y + \bar{z}
2010x+yˉ+zx + \bar{y} + z
3011x+yˉ+zˉx + \bar{y} + \bar{z}
4100xˉ+y+z\bar{x} + y + z
5101xˉ+y+zˉ\bar{x} + y + \bar{z}
6110xˉ+yˉ+z\bar{x} + \bar{y} + z
7111xˉ+yˉ+zˉ\bar{x} + \bar{y} + \bar{z}

A maxterm MiM_i is FALSE (equals 0) for exactly one input combination (row ii) 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:

f=Mifor all i where f=0f = \prod M_i \quad \text{for all } i \text{ where } f = 0

Using Π\Pi notation: f=Π(0,1,2)f = \Pi(0, 1, 2) means the AND of maxterms M0M_0, M1M_1, M2M_2.

For the example function f=x+yzf = x + y \cdot z, the rows where f=0f = 0 are 0, 1, 2. The CNF is:

f=(x+y+z)(x+y+zˉ)(x+yˉ+z)f = (x + y + z) \cdot (x + y + \bar{z}) \cdot (x + \bar{y} + z)

CNF is also canonical: every Boolean function has a unique CNF representation.

Relationship Between DNF and CNF

The maxterm MiM_i is the complement of the minterm mim_i, and vice versa:

Mi=miM_i = \overline{m_i} mi=Mim_i = \overline{M_i}

This can be verified: the minterm xˉyz\bar{x} \cdot y \cdot z is TRUE only for row 3; its complement is FALSE only for row 3, which is exactly the behaviour of maxterm M3=x+yˉ+zˉM_3 = x + \bar{y} + \bar{z}. Indeed, by De Morgan: xˉyz=x+yˉ+zˉ=M3\overline{\bar{x} \cdot y \cdot z} = x + \bar{y} + \bar{z} = M_3.

The DNF and CNF of the same function are related by:

DNF of f=complement of CNF of fˉ\text{DNF of } f = \text{complement of CNF of } \bar{f} CNF of f=complement of DNF of fˉ\text{CNF of } f = \text{complement of DNF of } \bar{f}

Worked Example: Deriving DNF and CNF for f=aˉd+bˉc+aˉbˉcˉdf = \bar{a} \cdot d + \bar{b} \cdot c + \bar{a} \cdot \bar{b} \cdot \bar{c} \cdot d

This is a 4-variable function f(a,b,c,d)f(a, b, c, d). We will build its full truth table and derive both normal forms.

Step 1: Build the Truth Table

For 4 variables there are 24=162^4 = 16 rows. We list aa, bb, cc, dd in counting order and evaluate the three terms and their OR.

Rowabcdaˉd\bar{a} \cdot dbˉc\bar{b} \cdot caˉbˉcˉd\bar{a} \cdot \bar{b} \cdot \bar{c} \cdot dff
000000000
100011011
200100101
300111101
401000000
501011001
601100000
701111001
810000000
910010000
1010100101
1110110101
1211000000
1311010000
1411100000
1511110000

Step 2: DNF from f=1f = 1 rows

Rows where f=1f = 1: 1, 2, 3, 5, 7, 10, 11.

Writing the minterms (using aa as MSB, dd as LSB):

m1=aˉbˉcˉdm_1 = \bar{a} \cdot \bar{b} \cdot \bar{c} \cdot d m2=aˉbˉcdˉm_2 = \bar{a} \cdot \bar{b} \cdot c \cdot \bar{d} m3=aˉbˉcdm_3 = \bar{a} \cdot \bar{b} \cdot c \cdot d m5=aˉbcˉdm_5 = \bar{a} \cdot b \cdot \bar{c} \cdot d m7=aˉbcdm_7 = \bar{a} \cdot b \cdot c \cdot d m10=abˉcdˉm_{10} = a \cdot \bar{b} \cdot c \cdot \bar{d} m11=abˉcdm_{11} = a \cdot \bar{b} \cdot c \cdot d

So the DNF is:

f=aˉbˉcˉd+aˉbˉcdˉ+aˉbˉcd+aˉbcˉd+aˉbcd+abˉcdˉ+abˉcdf = \bar{a}\bar{b}\bar{c}d + \bar{a}\bar{b}c\bar{d} + \bar{a}\bar{b}cd + \bar{a}b\bar{c}d + \bar{a}bcd + a\bar{b}c\bar{d} + a\bar{b}cd

Or in compact notation: f=Σ(1,2,3,5,7,10,11)f = \Sigma(1, 2, 3, 5, 7, 10, 11).

Step 3: CNF from f=0f = 0 rows

Rows where f=0f = 0: 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.

RowabcdMaxterm
00000a+b+c+da + b + c + d
40100a+bˉ+c+da + \bar{b} + c + d
60110a+bˉ+cˉ+da + \bar{b} + \bar{c} + d
81000aˉ+b+c+d\bar{a} + b + c + d
91001aˉ+b+c+dˉ\bar{a} + b + c + \bar{d}
121100aˉ+bˉ+c+d\bar{a} + \bar{b} + c + d
131101aˉ+bˉ+c+dˉ\bar{a} + \bar{b} + c + \bar{d}
141110aˉ+bˉ+cˉ+d\bar{a} + \bar{b} + \bar{c} + d
151111aˉ+bˉ+cˉ+dˉ\bar{a} + \bar{b} + \bar{c} + \bar{d}

So the CNF is:

f=(a+b+c+d)(a+bˉ+c+d)(a+bˉ+cˉ+d)(aˉ+b+c+d)(aˉ+b+c+dˉ)(aˉ+bˉ+c+d)(aˉ+bˉ+c+dˉ)(aˉ+bˉ+cˉ+d)(aˉ+bˉ+cˉ+dˉ)f = (a + b + c + d) \cdot (a + \bar{b} + c + d) \cdot (a + \bar{b} + \bar{c} + d) \cdot (\bar{a} + b + c + d) \cdot (\bar{a} + b + c + \bar{d}) \cdot (\bar{a} + \bar{b} + c + d) \cdot (\bar{a} + \bar{b} + c + \bar{d}) \cdot (\bar{a} + \bar{b} + \bar{c} + d) \cdot (\bar{a} + \bar{b} + \bar{c} + \bar{d})

Or in compact notation: f=Π(0,4,6,8,9,12,13,14,15)f = \Pi(0, 4, 6, 8, 9, 12, 13, 14, 15).

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., f=aˉd+bˉc+aˉbˉcˉdf = \bar{a} \cdot d + \bar{b} \cdot c + \bar{a} \cdot \bar{b} \cdot \bar{c} \cdot d 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

PropertyDNF (SOP of minterms)CNF (POS of maxterms)
FormOR of ANDsAND of ORs
Terms areMinterms (all vars, ANDed)Maxterms (all vars, ORed)
Canonical?Yes (unique)Yes (unique)
Constructed from rows wheref=1f = 1f=0f = 0
Compact notationΣ(row indices of 1s)\Sigma(\text{row indices of 1s})Π(row indices of 0s)\Pi(\text{row indices of 0s})
Minimised?NoNo