Week 4 Boolean Algebra Part-1 - 2021
Week 4 Boolean Algebra Part-1 - 2021
Part - 1
Rusdianto Roestam
After learning this material,
you should be able to explain:
Understand the basic operations and laws of Boolean algebra.
Relate these operations and laws to circuits composed of AND
gates, OR gates, and INVERTERS. Also relate these operations
and laws to circuits composed of switches.
Prove any of these laws in switching algebra using a truth table.
Apply these laws to the manipulation of algebraic expressions
including:
Multiplying out an expression to obtain a sum of products
(SOP)
Factoring an expression to obtain a product of sums (POS)
Simplifying an expression by applying one of the laws
Finding the complement of an expression
Introduction
l
We will use a Boolean variable, such as X or Y, to
represent the input or output of a switching circuit.
l
We will assume that each of these variables can
take on only two different values.
l
The symbols “0” and “1” are used to represent
these two different values.
l
Thus, if X is a Boolean (switching) variable, then
either X = 0 or X = 1.
Basic Operations
Called AND, OR, and complement (or inverse)
If contact X is open, the variable X is defined to be 0; if contact X is
closed, the variable X is defined to be 1.
The contacts in a switch can be normally open (NO) or normally
closed (NC). --- When the switch position is changed,
the NO contact closes and the NC contact opens,
so the NO and NC contacts are always in opposite states.
If X is the variable assigned to the NO contact, then the variable
assigned to the NC contact is the complement of X, denoted as X′
, where the prime (′) denotes complementation.
Inverter
If X is a switching variable,
l
l
X′ = 1 if X = 0
l
X′ = 0 if X = 1
l
The electronic circuit which forms the inverse of X
is referred to as an inverter
AND Operation
l
When switch contacts A and B are connected in
series (see truth table below),
l
there is an open circuit between the terminals if
either A or B or both are open (0),
l
there is a closed circuit between the terminals
only if both A and B are closed (1).
l
AND operation is written algebraically as C = A ·B.
l
usually write AB instead of A · B.
l
also referred to as logical (or Boolean)
multiplication.
OR operation
l
When switches A and B are connected in parallel,
l
there is a closed circuit between the terminals if either A
or B is closed (1), and there is an open circuit between
the terminals only if both A and B are open (0).
l
written algebraically as C = A + B.
Logic gates operation
Logic gates operate so that the voltage on inputs and
outputs of a gate is either in a low voltage range or a
high voltage range, except when the signals are
changing.
Switching algebra can be applied to logic gates by
assigning 0 and 1 to the two voltage ranges.
Usually, a 0 is assigned to the low voltage range and
a 1 to the high voltage range.
Fig below is Logic gates which perform the AND and
OR operations
Boolean Expressions and Truth
Tables
Boolean expressions are formed by application of the
basic operations to one or more variables or constants.
The simplest expressions consist of a single constant or
variable, such as 0, X, or Y′.
More complicated expressions are formed by combining
two or more other expressions using AND or OR, or by
complementing another expression.
Examples of expressions are: –> Expression (2-1), B′ is
formed first, then AB′, and finally AB′ + C.
Circuits for Expressions (2-1) and
(2-2)
If A = B = C = 1 and D = E = 0, the value of
Expression (2-2) is
[ A(C + D) ] ′ + BE = [ 1(1 + 0) ] ′ + 1 · 0 = [ 1(1) ] ′
+0=0+0=0
Truth table
A truth table (also called a table of combinations)
specifies the values of a Boolean expression for every
possible combination of values of the variables in the
expression.
The name truth table comes from a similar table which is
used in symbolic logic to list the truth or falsity of a
statement under all possible conditions.
We can use a truth table to specify the output values for
a circuit of logic gates in terms of the values of the input
variables.
Two-Input Circuit
and Truth Table
AB′ + C = (A + C)(B′ + C)
Two expressions are equal if they have the same value for every
possible combination of the variables.
Basic Theorems
Operations with 0 and 1:
X+0=X (2-4) X · 1 = X (2-4D)
X + 1 = 1 (2-5) X · 0 = 0 (2-5D)
Idempotent laws:
X+X=X (2-6) X · X = X (2-6D)
Involution law:
(X′)′ = X (2-7)
Laws of complementarity:
X + X′ = 1 (2-8)X · X′ = 0 (2-8D)
Each of these theorems is easily proved by showing that it is valid for both of
thepossible values of X. For example, to prove X + X′ = 1, we observe that if
X = 0, 0 + 0′ = 0 + 1 = 1, and if X = 1, 1 + 1′ = 1 + 0 = 1
=Y=Z=1
l
The result of the OR
operation will be 0 iff all
of the variables have
the value 0.
l
For example, X + Y + Z = 0
iff X = Y = Z = 0
Proof of Distribution Law
Using a truth table, it is easy to show that the
distributive law is valid:
X(Y + Z) = XY + XZ (2-11)
In addition to the ordinary distributive law, a
second distributive law is valid for Boolean
algebra but not for ordinary algebra:
X + YZ = (X + Y)(X + Z) (2-11D)
Proof of the second distributive law
l
(X + Y)(X + Z) = X(X + Z) + Y(X + Z) = XX + XZ +
YX + YZ (by (2-11))
l
= X + XZ + XY + YZ = X · 1 + XZ + XY + YZ (by
(2-6D) and (2-4D))
l
= X(1 + Z + Y) + YZ = X · 1 + YZ = X + YZ (by
(2-11), (2-5), and (2-4D))
l
In particular, an expression like A + BC, which
cannot be factored in ordinary algebra, is easily
factored using the second distributive law:
A + BC = (A + B)(A + C)
l
DeMorgan’s laws
(X + Y )′ = X′Y′ (2-12)
(XY)′ = X′ + Y′ (2-13)
verify these laws using a truth table:
Laws of Boolean Algebra
Operations with 0 and 1:
l l
Commutative laws:
l
1. X + 0 = X 1D. X · 1 = X l
6. X + Y = Y + X 6D. XY = YX
l
2. X + 1 = 1 2D. X · 0 = 0
Idempotent laws:
l Associative laws:
l
l
3. X + X = X 3D. X · X = X
l
7. (X + Y ) + Z = X + (Y + Z ) = X + Y + Z
l
7D. (XY )Z = X(YZ ) = XYZ
l
Involution law: l
Distributive laws:
8. X(Y + Z ) = XY + XZ
4. (X′)′ = X
l
l
l
8D. X + YZ = (X + Y )(X + Z )
Laws of complementarity:
l l
DeMorgan’s laws:
l
5. X + X′ = 1 5D. X · X′ = 0 l
9. (X + Y )′ = X′Y′ ----- 9D. (XY )′ = X′ + Y
′
Simplification Theorems
l
Uniting:
l
XY + XY′ = X (2-15)
l
(X + Y )(X + Y′) = X (2-15D)
l
Absorption:
l
X + XY = X (2-16)
l
X(X + Y ) = X (2-16D)
l
Elimination:
l
X + X ′Y = X + Y (2-17)
l
X(X′ + Y ) = X Y (2-17D)
l
Consensus:
l
XY + X′Z + YZ = XY + X′Z (2-18)
l
(X + Y )(X′ + Z)(Y + Z) = (X + Y )(X′ + Z) (2-18D)
Proof of Simplification Theorems
l
Proof of (2-15): XY + XY′ = X(Y + Y′) = X(1) = X
l
Proof of (2-16): X + XY = X · 1 + XY = X(1 + Y) = X · 1 =
X
l
Proof of (2-17): X + X′Y = (X + X′)(X + Y ) = 1(X + Y ) = X
+ Y ----- use 8D :x+yz = (x+y) (x+z)
l
Proof of (2-18): XY + X′Z + YZ = XY + X′Z + (1)YZ =
l XY + X′Z + YZ = XY + X′Z + (1)YZ =
l XY + X′Z + (X + X′)YZ = XY + XYZ + X′Z + X′YZ =
l XY + X′Z (using absorption twice – xy(1+z) + x’z(1+y))
Proof of (2-16D)
The other theorem can be proved using the dual
steps used to prove the first theorem.
For example, (2-16D) can be proved using the
dual steps of the (2-16) proof.
Proof of (2-16D):
X(X + Y ) = (X + 0)(X + Y ) = X + (0 · Y ) = X + 0 = X
--- use 8D :x+yz = (x+y) (x+z) and 2-16: (x+y)(x+z) = x +yz
Elimination theorem using switches
l
Fig (below) Its transmission is T = Y + XY′
because there is a closed circuit between the
terminals if switch Y is closed or switch X is
closed and switch Y′ is closed.
l
The following circuit is equivalent because if Y is
closed (Y = 1) both circuits have a transmission
of 1; if Y is open (Y′ = 1) both circuits have a
transmission of X.
Simplification of a logic gate circuit
l
In Figure below, the output of circuit (a) is
l
F = A(A′ + B)
l
By the elimination theorem, the expression for F
simplifies to AB. Therefore, circuit (a) can be
replaced with the equivalent circuit (b).
Example 1 - 2
l
Use absorption theorem (2-16)
l
--- Simplify Z = A′BC + A′
l if we let X = A′ and Y = BC.
l the expression simplifies to Z = X + XY = X = A′.
l
Z = X + Y = B′D + C′E′ + (AB + C)′
l Note that in this example we let X = (AB + C)′ rather
than (AB + C) in order to match the form of the
elimination theorem (2-17).
Theorems of Boolean Algebra
Table 2-4
l
Uniting theorems:
l
1. XY + XY′ = X 1D. (X + Y )(X + Y′) = X
l
Absorption theorems:
l
2. X + XY = X 2D. X(X + Y ) = X
Elimination theorems:
l
l
Duality:
l
4. (X + Y + Z + · · · ) D = XYZ. . .
l
4D. (XYZ. . . ) D = X + Y + Z + · · ·
l
Theorems for multiplying out and factoring:
l
5. (X + Y )(X′ + Z ) = XZ + X′Y
l
5D. XY + X′Z = (X + Z )(X′ + Y )
l
Consensus theorems:
6. XY + YZ + X′Z = XY + X′Z
6D.(X + Y )(Y + Z )(X′ + Z ) = (X + Y )(X′ + Z )
Multiplying Out and Factoring
l
An expression is said to be in sum-of-products
(SOP) form when all products are the products of
single variables.
l
This form is the end result when an expression is
fully multiplied out.
l
It is usually easy to recognize a sum-of-products
expression because it consists of a sum of
product terms:
AB′ + CD′E + AC′E′ (2-19)
Multiplying Out and Factoring (2)
l
In degenerate cases, one or more of the product
terms may consist of a single variable.
l
For example ---- considered as SOP form:
l
ABC′ + DEFG + H (2-20)
l
A + B′ + C + D′E (2-21)
Example --- Not SOP form:
l
l
(A + B)CD + EF
l because the A + B term enters into a product but is not a single
variable.
Multiplying Out and Factoring (3)
l
When multiplying out an expression, apply the
second distributive law first when possible.
l
For example, to multiply out
l
(A + BC )(A + D + E ) let X = A, Y = BC, Z = D + E
l Then:
l
(X + Y)(X + Z) = X + YZ = A + BC(D + E) = A + BCD + BCE
Multiplying Out and Factoring (4)
the same way –- by multiplying out the original
l
distributive law, so
l
A + B′CD = (A + B′)(A + C)(A + D)
Multiplying Out and Factoring (8)
l
Example 2: Factor AB′ + C′D.
l
AB′ + C′D = (AB′ + C′)(AB′ + D) ← note how X +
YZ = (X + Y)(X + Z) was applied here
l
= (A + C′)(B′ + C′)(A + D)(B′ + D) ← the second
distributive law was applied again to each term
Factor using the second distributive law
Example 1
Factor A + B′CD.
l
distributive law,
So A + B′CD = (A + B′)(A + CD) =(A + B′)(A + C)(A + D)
Factor using the second distributive law
Example 2
l
Factor AB′ + C′D.
l
AB′ + C′D = (AB′ + C′)(AB′ + D)
l ← note how X + YZ = (X + Y)(X + Z)
was applied here
l
= (A + C′)(B′ + C′)(A + D)(B′ + D)
l ← the second distributive law was
applied again to each term
Factor using the second distributive law
Example 3
l
Factor C′D + C′E′ + G′H.
l
C′D + C′E′ + G′H = C′(D + E′) + G′H
l ← first apply the ordinary distributive law, XY + XZ =
X(Y + Z)
l
= (C′ + G′H)((D + E′) + G′H)
l ← then apply the second distributive law
l
= (C′ + G′)(C′ + H)(D + E′ + G′)(D + E′ + H)
l ← now identify X, Y, and Z in each expression and
complete the factoring
As in Example 3, the ordinary distributive law should be applied
l