Sub topic 6
Simplifying Boolean Expressions Algebraically
Assume you know binary numbers, basic logic gates, and Boolean notation. In Boolean algebra, a variable has one of two values: 0 or 1. A complement means NOT, written \(A'\). The operators are AND, written by adjacency as \(AB\), and OR, written as \(A+B\).
Algebraic simplification replaces an expression with an equivalent expression that uses fewer operations, literals, or gates. A literal is a variable or its complement, such as \(A\) or \(A'\). The simplified form can reduce circuit cost and delay.
Core identities
| Identity | Rule |
|---|---|
| Identity | \(A+0=A,\quad A\cdot1=A\) |
| Null element | \(A+1=1,\quad A\cdot0=0\) |
| Idempotent | \(A+A=A,\quad AA=A\) |
| Complement | \(A+A'=1,\quad AA'=0\) |
| Absorption | \(A+AB=A,\quad A(A+B)=A\) |
| Distributive | \(A(B+C)=AB+AC\) |
The complement operator has the highest priority. Parentheses should be used when an expression could be misunderstood.
A systematic simplification method
Use these steps:
- Remove repeated terms with the idempotent laws.
- Look for a variable and its complement.
- Apply absorption to remove terms that add no new cases.
- Factor common terms when this exposes a complement.
- Repeat until no identity reduces the expression.
For example:
\[ F=A+AB \]
Factor \(A\):
\[ F=A(1+B) \]
Since \(1+B=1\):
\[ F=A \]
This is the absorption law. The term \(AB\) is unnecessary because whenever \(AB=1\), \(A\) is already 1.
A less direct example is:
\[ F=AB+AB'+AC \]
First factor \(A\):
\[ F=A(B+B'+C) \]
Because \(B+B'=1\), this becomes:
\[ F=A(1+C)=A \]
The term \(AC\) is also absorbed after the complement pair is recognized.
Consensus and useful transformations
The consensus theorem is:
\[ AB+A'C+BC=AB+A'C \]
The term \(BC\) is called the consensus term. It is redundant because the first two terms already cover every case where \(BC=1\).
For example:
\[ F=XY+X'Z+YZ \]
The first two terms have opposite forms of \(X\), and their consensus is \(YZ\). Therefore:
\[ F=XY+X'Z \]
A common error is to remove a term merely because it looks larger. A term is removable only when an identity proves that its removal preserves every output value.
from itertools import product
def equivalent(f, g, variables):
return all(
f(*values) == g(*values)
for values in product([0, 1], repeat=len(variables))
)
# XY + X'Z + YZ == XY + X'Z
left = lambda x, y, z: (x and y) or ((not x) and z) or (y and z)
right = lambda x, y, z: (x and y) or ((not x) and z)
print(equivalent(left, right, ["X", "Y", "Z"]))Exercise
Simplify F = A'B + AB + AC.
Show answer
Combine A'B + AB as B(A' + A) = B. Thus F = B + AC.