About

4.2 Boolean Identities, DeMorgan & Sum-of-Products

Theory: Boolean Identities, DeMorgan & Sum-of-Products

Every gate in a circuit costs money, space, power and delay. Two different-looking Boolean expressions can describe exactly the same function (the same truth table), and the shorter one gives a cheaper, faster circuit. This page shows how to evaluate a Boolean function, the algebraic laws (identities) used to rewrite it, DeMorgan’s law for complements, and how to read a function straight off a truth table in canonical sum-of-products form (Null & Lobur, Ch. 3).

Notation: complement is written with a prime, x′x' (the overbar x‾\overline{x} in the textbook means the same).

Boolean Functions and Rules of Precedence

A Boolean function combines variables with operators, e.g. F(x,y,z)=xz′+yF(x, y, z) = xz' + y. To read an expression correctly you need the precedence rules, highest first:

PriorityOperatorAnalogy
1 (highest)NOT (′')like a minus sign attached to a number
2AND (product)like multiplication
3 (lowest)OR (sum)like addition

Parentheses override precedence. So xz′+yxz' + y means (x⋅(z′))+y(x \cdot (z')) + y, not x⋅(z+y)′x \cdot (z + y)'.

A prime applies only to what it is directly attached to. xy′xy' complements only yy; (xy)′(xy)' complements the whole product. These are different functions.

Evaluating a Function with a Truth Table

Procedure:

  1. List all 2n2^n input rows.
  2. Add one column for each sub-expression, in precedence order (NOTs first, then products, then the final sum).
  3. Fill each column from the columns before it.

Mini-example (lecture function)

F(x,y,z)=xz′+yF(x, y, z) = xz' + y:

xxyyzzz′z'xz′xz'F=xz′+yF = xz' + y
000100
001000
010101
011001
100111
101000
110111
111001

Boolean Identities

Most identities come in pairs: an AND (product) form and an OR (sum) form. Each is obtained from the other by swapping AND with OR and 0 with 1 (this is called duality).

Group 1: identities with constants and a single variable

IdentityAND formOR form
Identity law1x=x1x = x0+x=x0 + x = x
Null (dominance) law0x=00x = 01+x=11 + x = 1
Idempotent lawxx=xxx = xx+x=xx + x = x
Inverse lawxx′=0xx' = 0x+x′=1x + x' = 1

Group 2: laws that look like ordinary algebra

IdentityAND formOR form
Commutative lawxy=yxxy = yxx+y=y+xx + y = y + x
Associative law(xy)z=x(yz)(xy)z = x(yz)(x+y)+z=x+(y+z)(x+y)+z = x+(y+z)
Distributive lawx+yz=(x+y)(x+z)x + yz = (x+y)(x+z)x(y+z)=xy+xzx(y+z) = xy + xz

Group 3: laws with no ordinary-algebra equivalent

IdentityAND formOR form
Absorption lawx(x+y)=xx(x+y) = xx+xy=xx + xy = x
DeMorgan’s law(xy)′=x′+y′(xy)' = x' + y'(x+y)′=x′y′(x+y)' = x'y'
Double complement law(x′)′=x(x')' = x

The distributive law works both ways in Boolean algebra: AND distributes over OR (as in ordinary algebra) and OR distributes over AND: x+yz=(x+y)(x+z)x + yz = (x+y)(x+z). The second one has no counterpart with numbers, but it is often the key step in a simplification.

Mini-example

Absorption from the other laws: x+xy=x⋅1+xyx + xy = x \cdot 1 + xy (Identity) =x(1+y)= x(1 + y) (Distributive) =x⋅1= x \cdot 1 (Null) =x= x (Identity).

DeMorgan’s Law

(xy)′=x′+y′(x+y)′=x′y′(xy)' = x' + y' \qquad\qquad (x+y)' = x'y'

In words: the complement of a product is the sum of the complements, and the complement of a sum is the product of the complements. Proof by truth table:

xxyy(xy)′(xy)'x′+y′x' + y'(x+y)′(x+y)'x′y′x'y'
001111
011100
101100
110000

Why it matters: sometimes it is more economical to build the complement of a function and invert the result at the end, and DeMorgan is how you move between the two forms. It is also what turns AND/OR circuits into NAND-only or NOR-only circuits.

Extended DeMorgan: Complementing a Whole Function

DeMorgan extends to any number of variables: (x1x2⋯xn)′=x1′+x2′+⋯+xn′(x_1 x_2 \cdots x_n)' = x_1' + x_2' + \cdots + x_n' and (x1+⋯+xn)′=x1′⋯xn′(x_1 + \cdots + x_n)' = x_1' \cdots x_n'.

Recipe for the complement F′F' of any expression:

  1. Replace each variable by its complement (x→x′x \to x', x′→xx' \to x).
  2. Change every AND to OR and every OR to AND.
  3. Keep the grouping: put parentheses around what used to be each product term, so the structure is preserved.

Mini-example (lecture)

F(x,y,z)=xy+x′z+yz′F(x,y,z) = xy + x'z + yz'.

F′=(xy+x′z+yz′)′=(xy)′ (x′z)′ (yz′)′DeMorgan (OR form, 3 terms)=(x′+y′) (x+z′) (y′+z)DeMorgan (AND form) on each, Double complement\begin{aligned} F' &= \big(xy + x'z + yz'\big)' \\ &= (xy)'\,(x'z)'\,(yz')' && \text{DeMorgan (OR form, 3 terms)} \\ &= (x' + y')\,(x + z')\,(y' + z) && \text{DeMorgan (AND form) on each, Double complement} \end{aligned}

Simplifying with Identities

Procedure:

  1. Remove complements of whole groups with DeMorgan.
  2. Multiply out (Distributive) or factor (Distributive in reverse) to expose patterns like y+y′y + y' or yy′yy'.
  3. Replace y+y′=1y + y' = 1, yy′=0yy' = 0 (Inverse), then clean up with Identity, Null, Idempotent and Absorption.
  4. Cite the law used at each step. Check the final answer with a truth table if unsure.

Useful patterns to recognise immediately:

PatternResultLaws
xy+xy′xy + xy'xxDistributive, Inverse, Identity
(x+y)(x+y′)(x+y)(x+y')xxDistributive (x+yy′x + yy'), Inverse, Identity
x+x′yx + x'yx+yx + yDistributive ((x+x′)(x+y)(x+x')(x+y)), Inverse, Identity
x(x′+y)x(x' + y)xyxyDistributive, Inverse, Identity
xy+x′z+yzxy + x'z + yzxy+x′zxy + x'zconsensus (see Worked Example 4)

Mini-example

x+x′y=(x+x′)(x+y)x + x'y = (x + x')(x + y) (Distributive, OR over AND) =1⋅(x+y)= 1 \cdot (x + y) (Inverse) =x+y= x + y (Identity).

Canonical Sum-of-Products (SOP) from a Truth Table

A sum-of-products is an OR of AND terms, e.g. xy′+yzxy' + yz. A truth table converts directly into one:

Procedure (canonical SOP):

  1. Look only at the rows where F=1F = 1.
  2. For each such row write a product term containing every variable: the variable itself if it is 1 in that row, its complement if it is 0. (Such a term is a minterm; it is 1 in exactly that row.)
  3. OR all these terms together.

The result is the canonical sum-of-products form. It is correct but usually not the simplest; simplify it afterwards with identities or a Karnaugh map.

Minterm shorthand: number each row by its binary value (xyz=101x y z = 101 is row 5) and write F=Σm(…)F = \Sigma m(\ldots) listing the rows where F=1F = 1.

Mini-example (lecture)

For F=xz′+yF = xz' + y (table above), F=1F = 1 in rows 010,011,100,110,111010, 011, 100, 110, 111:

F=x′yz′+x′yz+xy′z′+xyz′+xyz=Σm(2,3,4,6,7)F = x'yz' + x'yz + xy'z' + xyz' + xyz = \Sigma m(2, 3, 4, 6, 7)

Product-of-sums (POS) is the dual form. Use the rows where F=0F = 0; for each, write a sum term (a maxterm) with the variable complemented if it is 1 in that row and uncomplemented if it is 0; AND the terms. For F=xz′+yF = xz' + y the 0-rows are 000,001,101000, 001, 101: F=(x+y+z)(x+y+z′)(x′+y+z′)=ΠM(0,1,5)F = (x + y + z)(x + y + z')(x' + y + z') = \Pi M(0, 1, 5). Each maxterm is 0 in exactly its own row.


Worked Examples

Exercise 1

Construct the truth table for F(x,y,z)=x′y+xz′F(x, y, z) = x'y + xz', showing every intermediate column, and give FF in Σm\Sigma m notation.

Show solution ↓
Solution

Precedence: first the NOTs (x′x', z′z'), then the two products, then the OR.

rowxxyyzzx′x'z′z'x′yx'yxz′xz'F=x′y+xz′F = x'y + xz'
000011000
100110000
201011101
301110101
410001011
510100000
611001011
711100000

F=Σm(2,3,4,6)F = \Sigma m(2, 3, 4, 6), i.e. canonical SOP F=x′yz′+x′yz+xy′z′+xyz′F = x'yz' + x'yz + xy'z' + xyz'.

Sanity check: x′yx'y should be 1 exactly when x=0,y=1x = 0, y = 1 (rows 2, 3) ✓; xz′xz' exactly when x=1,z=0x = 1, z = 0 (rows 4, 6) ✓.

Exercise 2

Use extended DeMorgan to find the complement of:

(a) F(x,y,z)=xy+x′z+yz′F(x, y, z) = xy + x'z + yz'

(b) G(x,y,z)=x(y′+z)+x′yz′G(x, y, z) = x(y' + z) + x'yz'

Verify each answer with a truth table.

Show solution ↓
Solution

(a) Complement each variable, swap AND ↔ OR, keep each old product grouped:

F′=(x′+y′)(x+z′)(y′+z)F' = (x' + y')(x + z')(y' + z)

(b) Work from the outside in. GG is a sum of two terms, so G′G' is the product of their complements:

G′=(x(y′+z))′⋅(x′yz′)′DeMorgan (OR form)=(x′+(y′+z)′) (x+y′+z)DeMorgan (AND form), Double complement=(x′+yz′) (x+y′+z)DeMorgan on (y′+z)′\begin{aligned} G' &= \big(x(y'+z)\big)' \cdot (x'yz')' && \text{DeMorgan (OR form)} \\ &= \big(x' + (y'+z)'\big)\,(x + y' + z) && \text{DeMorgan (AND form), Double complement} \\ &= (x' + yz')\,(x + y' + z) && \text{DeMorgan on } (y'+z)' \end{aligned}

Verification (a complement must be 1 exactly where the original is 0):

xyzxyzFF(x′+y′)(x+z′)(y′+z)(x'+y')(x+z')(y'+z)GG(x′+yz′)(x+y′+z)(x'+yz')(x+y'+z)
0000101
0011001
0101010
0111001
1000110
1010110
1101001
1111010

Row by row, each complement column is the opposite of its function ✓. (Spot-check row 001001 of (b): G=0⋅(1+1)+1⋅0⋅0=0G = 0\cdot(1+1) + 1\cdot0\cdot0 = 0; G′=(1+0)(0+1+1)=1G' = (1 + 0)(0 + 1 + 1) = 1 ✓.)

Exercise 3

(Lecture example) Simplify F(x,y,z)=(x+y)(x+y′)(xz′)′F(x, y, z) = (x + y)(x + y')(xz')', citing the identity used at every step.

Show solution ↓
Solution
F=(x+y)(x+y′)(xz′)′=(x+y)(x+y′)(x′+z)DeMorgan, Double complement=(xx+xy′+xy+yy′)(x′+z)Distributive (multiply out)=(x+x(y′+y)+yy′)(x′+z)Idempotent (xx=x), Distributive (factor x)=(x+x⋅1+0)(x′+z)Inverse (y′+y=1, yy′=0)=(x+x)(x′+z)Identity (x⋅1=x, …+0)=x(x′+z)Idempotent (x+x=x)=xx′+xzDistributive=0+xzInverse=xzIdentity\begin{aligned} F &= (x + y)(x + y')(xz')' \\ &= (x + y)(x + y')(x' + z) && \text{DeMorgan, Double complement} \\ &= (xx + xy' + xy + yy')(x' + z) && \text{Distributive (multiply out)} \\ &= (x + x(y' + y) + yy')(x' + z) && \text{Idempotent } (xx = x)\text{, Distributive (factor } x) \\ &= (x + x\cdot 1 + 0)(x' + z) && \text{Inverse } (y'+y = 1,\ yy' = 0) \\ &= (x + x)(x' + z) && \text{Identity } (x\cdot1 = x,\ \ldots + 0) \\ &= x(x' + z) && \text{Idempotent } (x + x = x) \\ &= xx' + xz && \text{Distributive} \\ &= 0 + xz && \text{Inverse} \\ &= xz && \text{Identity} \end{aligned}

Shortcut: the first two factors are the pattern (x+y)(x+y′)=x+yy′=x+0=x(x + y)(x + y') = x + yy' = x + 0 = x (Distributive AND form, Inverse, Identity), giving x(x′+z)=xzx(x' + z) = xz immediately.

Check by truth table (xyzxyz from 000 to 111): FF = 0,0,0,0,0,1,0,10,0,0,0,0,1,0,1 and xzxz = 0,0,0,0,0,1,0,10,0,0,0,0,1,0,1 ✓. A circuit with 3 OR/AND gates and inverters reduces to a single AND gate.

Exercise 4

Prove the consensus theorem xy+x′z+yz=xy+x′zxy + x'z + yz = xy + x'z using identities.

Show solution ↓
Solution

The trick is to multiply the redundant term yzyz by 1=x+x′1 = x + x' so it splits into pieces that can be absorbed.

xy+x′z+yz=xy+x′z+yz⋅1Identity=xy+x′z+yz(x+x′)Inverse=xy+x′z+xyz+x′yzDistributive, Commutative=(xy+xyz)+(x′z+x′yz)Commutative, Associative=xy(1+z)+x′z(1+y)Distributive (factor)=xy⋅1+x′z⋅1Null law (1+z=1)=xy+x′zIdentity\begin{aligned} xy + x'z + yz &= xy + x'z + yz\cdot 1 && \text{Identity} \\ &= xy + x'z + yz(x + x') && \text{Inverse} \\ &= xy + x'z + xyz + x'yz && \text{Distributive, Commutative} \\ &= (xy + xyz) + (x'z + x'yz) && \text{Commutative, Associative} \\ &= xy(1 + z) + x'z(1 + y) && \text{Distributive (factor)} \\ &= xy\cdot 1 + x'z \cdot 1 && \text{Null law } (1 + z = 1) \\ &= xy + x'z && \text{Identity} \end{aligned}

Intuition: if yz=1yz = 1 then y=z=1y = z = 1; whichever value xx has, either xyxy (when x=1x = 1) or x′zx'z (when x=0x = 0) is already 1. So yzyz never contributes anything new.

Truth table check: both sides give 0,1,0,1,0,0,1,10,1,0,1,0,0,1,1 for xyz=000…111xyz = 000 \ldots 111 ✓.

Exercise 5

F(x,y,z)=Σm(0,2,4,5,6)F(x, y, z) = \Sigma m(0, 2, 4, 5, 6).

(a) Write the canonical sum-of-products and the canonical product-of-sums.

(b) Simplify FF algebraically.

Show solution ↓
Solution

(a) Translate each row number to binary (xyzx y z):

rowxyzxyzFFminterm (if F=1F=1)maxterm (if F=0F=0)
00001x′y′z′x'y'z'
10010x+y+z′x + y + z'
20101x′yz′x'yz'
30110x+y′+z′x + y' + z'
41001xy′z′xy'z'
51011xy′zxy'z
61101xyz′xyz'
71110x′+y′+z′x' + y' + z'
F=x′y′z′+x′yz′+xy′z′+xy′z+xyz′(canonical SOP)F = x'y'z' + x'yz' + xy'z' + xy'z + xyz' \qquad \text{(canonical SOP)}F=(x+y+z′)(x+y′+z′)(x′+y′+z′)=ΠM(1,3,7)(canonical POS)F = (x + y + z')(x + y' + z')(x' + y' + z') = \Pi M(1, 3, 7) \qquad \text{(canonical POS)}

(b) Pair minterms that differ in exactly one variable. x′y′z′x'y'z' pairs with x′yz′x'yz' and xy′z′xy'z' pairs with xyz′xyz' (each pair differs only in yy), but xy′zxy'z can only pair with xy′z′xy'z' (differ only in zz), which is already used. The Idempotent law (a=a+aa = a + a) lets us use xy′z′xy'z' twice.

F=x′y′z′+x′yz′+xy′z′+xyz′+xy′z=x′y′z′+x′yz′+xy′z′+xyz′+xy′z′+xy′zIdempotent (xy′z′=xy′z′+xy′z′)=x′z′(y′+y)+xz′(y′+y)+xy′(z′+z)Commutative, Distributive=x′z′⋅1+xz′⋅1+xy′⋅1Inverse=x′z′+xz′+xy′Identity=z′(x′+x)+xy′Distributive=z′+xy′Inverse, Identity\begin{aligned} F &= x'y'z' + x'yz' + xy'z' + xyz' + xy'z \\ &= x'y'z' + x'yz' + xy'z' + xyz' + xy'z' + xy'z && \text{Idempotent } (xy'z' = xy'z' + xy'z') \\ &= x'z'(y' + y) + xz'(y' + y) + xy'(z' + z) && \text{Commutative, Distributive} \\ &= x'z'\cdot1 + xz'\cdot1 + xy'\cdot1 && \text{Inverse} \\ &= x'z' + xz' + xy' && \text{Identity} \\ &= z'(x' + x) + xy' && \text{Distributive} \\ &= z' + xy' && \text{Inverse, Identity} \end{aligned}

Check: z′+xy′z' + xy' is 1 when z=0z = 0 (rows 0, 2, 4, 6) or when x=1,y=0x = 1, y = 0 (rows 4, 5). Union ={0,2,4,5,6}= \{0, 2, 4, 5, 6\} ✓.

Exercise 6

A full adder adds three bits xx, yy and a carry-in zz, producing Sum and Carry-out. From its truth table, derive canonical SOP expressions and show algebraically that

Sum=x⊕y⊕z,Cout=xy+z(x⊕y).\text{Sum} = x \oplus y \oplus z, \qquad \text{Cout} = xy + z(x \oplus y).
Show solution ↓
Solution

Truth table (x+y+zx + y + z in binary = Cout Sum):

xxyyzzCoutSum
00000
00101
01001
01110
10001
10110
11010
11111

Canonical SOP (rows where the output is 1):

Sum=x′y′z+x′yz′+xy′z′+xyz=Σm(1,2,4,7),Cout=x′yz+xy′z+xyz′+xyz=Σm(3,5,6,7)\text{Sum} = x'y'z + x'yz' + xy'z' + xyz = \Sigma m(1,2,4,7), \qquad \text{Cout} = x'yz + xy'z + xyz' + xyz = \Sigma m(3,5,6,7)

Carry-out:

Cout=x′yz+xy′z+xyz′+xyz=z(x′y+xy′)+xy(z′+z)Distributive (factor z and xy)=z(x⊕y)+xy⋅1definition of XOR, Inverse=xy+z(x⊕y)Identity, Commutative\begin{aligned} \text{Cout} &= x'yz + xy'z + xyz' + xyz \\ &= z(x'y + xy') + xy(z' + z) && \text{Distributive (factor } z \text{ and } xy) \\ &= z(x \oplus y) + xy\cdot 1 && \text{definition of XOR, Inverse} \\ &= xy + z(x \oplus y) && \text{Identity, Commutative} \end{aligned}

Sum: factor on xx:

Sum=x′(y′z+yz′)+x(y′z′+yz)\text{Sum} = x'(y'z + yz') + x(y'z' + yz)

The first bracket is y⊕zy \oplus z. For the second, show it is the complement of y⊕zy \oplus z:

(y⊕z)′=(y′z+yz′)′=(y′z)′ (yz′)′DeMorgan=(y+z′)(y′+z)DeMorgan, Double complement=yy′+yz+z′y′+z′zDistributive=0+yz+y′z′+0Inverse, Commutative=y′z′+yzIdentity\begin{aligned} (y \oplus z)' &= (y'z + yz')' \\ &= (y'z)'\,(yz')' && \text{DeMorgan} \\ &= (y + z')(y' + z) && \text{DeMorgan, Double complement} \\ &= yy' + yz + z'y' + z'z && \text{Distributive} \\ &= 0 + yz + y'z' + 0 && \text{Inverse, Commutative} \\ &= y'z' + yz && \text{Identity} \end{aligned}

So with w=y⊕zw = y \oplus z:

Sum=x′w+xw′=x⊕w=x⊕(y⊕z)=x⊕y⊕z\text{Sum} = x'w + xw' = x \oplus w = x \oplus (y \oplus z) = x \oplus y \oplus z

(XOR is associative, so the brackets do not matter.)

Check: Sum is 1 in rows 1, 2, 4, 7, which are exactly the rows with an odd number of 1s, as x⊕y⊕zx \oplus y \oplus z requires ✓. Cout row 011011: xy+z(x⊕y)=0+1⋅(0⊕1)=1xy + z(x \oplus y) = 0 + 1\cdot(0 \oplus 1) = 1 ✓.

Exercise 7

Using identities, simplify:

(a) F1=xy+xy′z+x′F_1 = xy + xy'z + x'

(b) F2=(x+y′)(x′+y′)F_2 = (x + y')(x' + y')

(c) F3=x′y′z+x′yz+xy′z+xyzF_3 = x'y'z + x'yz + xy'z + xyz

Show solution ↓
Solution

(a)

F1=x′+xy+xy′zCommutative=x′+x(y+y′z)Distributive=x′+x((y+y′)(y+z))Distributive (OR over AND)=x′+x(y+z)Inverse, Identity=(x′+x)(x′+y+z)Distributive (OR over AND)=x′+y+zInverse, Identity\begin{aligned} F_1 &= x' + xy + xy'z && \text{Commutative} \\ &= x' + x(y + y'z) && \text{Distributive} \\ &= x' + x\big((y + y')(y + z)\big) && \text{Distributive (OR over AND)} \\ &= x' + x(y + z) && \text{Inverse, Identity} \\ &= (x' + x)(x' + y + z) && \text{Distributive (OR over AND)} \\ &= x' + y + z && \text{Inverse, Identity} \end{aligned}

Check: F1=0F_1 = 0 only when x=1x = 1, y=0y = 0, z=0z = 0 (row 4): original gives 0+0+0=00 + 0 + 0 = 0 ✓, and every other row gives 1 in both forms.

(b)

F2=(y′+x)(y′+x′)Commutative=y′+xx′Distributive (AND form: (a+b)(a+c)=a+bc)=y′+0=y′Inverse, Identity\begin{aligned} F_2 &= (y' + x)(y' + x') && \text{Commutative} \\ &= y' + xx' && \text{Distributive (AND form: } (a+b)(a+c) = a + bc) \\ &= y' + 0 = y' && \text{Inverse, Identity} \end{aligned}

(c) (the first Karnaugh-map example of the lecture, done algebraically)

F3=x′z(y′+y)+xz(y′+y)Distributive=x′z+xzInverse, Identity=z(x′+x)=zDistributive, Inverse, Identity\begin{aligned} F_3 &= x'z(y' + y) + xz(y' + y) && \text{Distributive} \\ &= x'z + xz && \text{Inverse, Identity} \\ &= z(x' + x) = z && \text{Distributive, Inverse, Identity} \end{aligned}

Four minterms collapse to the single variable zz: the output does not depend on xx or yy at all. The next section (Karnaugh maps) finds this kind of result by inspection.