0% found this document useful (0 votes)
33 views52 pages

Week 4 Boolean Algebra Part-1 - 2021

The document provides an overview of Boolean algebra concepts including: - Basic Boolean operations like AND, OR, and complementation - How these operations relate to switching circuits and logic gates - Laws of Boolean algebra such as commutative, associative, distributive, and De Morgan's laws - How to prove these laws using truth tables - Techniques for simplifying Boolean expressions using theorems like uniting, absorption, and elimination The document is intended to explain the fundamental concepts of Boolean algebra and their applications in digital circuits.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views52 pages

Week 4 Boolean Algebra Part-1 - 2021

The document provides an overview of Boolean algebra concepts including: - Basic Boolean operations like AND, OR, and complementation - How these operations relate to switching circuits and logic gates - Laws of Boolean algebra such as commutative, associative, distributive, and De Morgan's laws - How to prove these laws using truth tables - Techniques for simplifying Boolean expressions using theorems like uniting, absorption, and elimination The document is intended to explain the fundamental concepts of Boolean algebra and their applications in digital circuits.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Week 4: Boolean Algebra

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

Any expression can be substituted for the variable X in these theorems.


Thus, by Theorem (2-5),
(AB′ + D)E + 1 = 1
and by Theorem (2-8D),
(AB′ + D)(AB′ + D)′ = 0
Circuit with 2 switches (example)
Commutative, Associative,
Distributive, and DeMorgan’s Laws
The commutative laws for AND and OR, which follow
directly from the definitions of the AND and OR
operations, are
XY = YX (2-9)
X+Y=Y+X (2-9D)
The associative laws also apply to AND and OR:
(XY)Z = X(YZ) = XYZ (2-10)
(X + Y) + Z = X + (Y + Z) = X + Y + Z (2-10D)
Proof of Associative Law for AND
Associative laws
using AND and OR gates
If any of the variables
l

have the value 0, the


result of the AND
operation will be 0.
For example, XYZ = 1 iff X
l

=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 Then, by the uniting theorem (2-15D), the expression


reduces to Z = X = A + B′C
Example 3

By the elimination theorem (2-17):


l

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

3. X + X′Y = X + Y 3D. X(X′ + Y ) = XY


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

expression completely and then eliminating


redundant terms:
(A + BC)(A + D + E) = A + AD + AE + ABC + BCD + BCE
= A(1 + D + E + BC) + BCD + BCE
= A + BCD + BCE
Compare to the previous way in the slide before!!!
l
Problem SOP (7.24)

o (a) Use gate equivalences to


convert the circuit into a four-level
circuit containing only NAND
gates and a minimum number of
inverters. (Assume the inputs are
available only in uncomplemented
form.)
o (b) Derive a minimum SOP
expression for f .
o (c) By manipulating the expression
for f , find a three-level circuit
containing only five NAND gates
and inverters.
Multiplying Out and Factoring (5)
l
Both distributive laws can be used to factor an
expression to obtain a product-of- sums form.
l
An expression is in product-of-sums (POS) form
when all sums are the sums of single variables.
l
It is usually easy to recognize a product-of-sums
expression since it consists of a product of sum
terms:
l
(A + B′)(C + D′ + E)(A + C′ + E′) –-------- (2-22)
Multiplying Out and Factoring (6)
in degenerate cases, one or more of the sum
terms may consist of a single variable. For
example,
l
(A + B)(C + D + E)F (2-23)
l
AB′C(D′ + E) (2-24)
are still considered to be in product-of-sums form, but (A
+ B)(C + D) + EF is not.
Example 1 --- how to factor using the second
distributive law: - p.49

Factor A + B′CD. This is of the form X + YZ where X = A, Y = B′, and Z = CD, so


A + B′CD = (X + Y)(X + Z) = (A + B′)(A + CD)
A + CD can be factored again using the second distributive law, so
A + B′CD = (A + B′)(A + C)(A + D)
Example 2

Factor AB′ + C′D.


AB′ + C′D = (AB′ + C′)(AB′ + D) ← note how X + YZ = (X + Y)(X + Z) was applied here
= (A + C′)(B′ + C′)(A + D)(B′ + D) ← the second distributive law was applied again to each term
Example 3
Factor C′D + C′E′ + G′H.
C′D + C′E′ + G′H = C′(D + E′) + G′H ← first apply
the ordinary distributive law,
XY + XZ = X(Y + Z)
= (C′ + G′H)((D + E′) + G′H) ← then apply the
second distributive law
= (C′ + G′)(C′ + H)(D + E′ + G′)(D + E′ + H) ←
now identify X, Y, and Z in each expression and
complete the factoring
Multiplying Out and Factoring (7)
l
An expression is fully factored iff it is in product-
of-sums form. Any expression not in this form can
be factored further.
l
The following examples illustrate how to factor
using the second distributive law:
l
Example 1: Factor A + B′CD. This is of the form X
+ YZ where X = A, Y = B′, and Z = CD, so
l
A + B′CD = (X + Y)(X + Z) = (A + B′)(A + CD)
A + CD can be factored again using the second
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

l This is of the form X + YZ where X = A, Y = B′, and Z


= CD,
l So A + B′CD = (X + Y)(X + Z) = (A + B′)(A + CD)
A + CD can be factored again using the second
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

before the second law when factoring an expression.


Circuits for
Equations (2-19) and (2-21)
Circuits for
Equations (2-22) and (2-24)
Complementing Boolean
Expressions
1.The inverse or complement of any Boolean
expression can easily be found by successively
applying DeMorgan’s laws.
2.DeMorgan’s laws are easily generalized to n
variables:
3.(X 1 + X 2 + X 3 + · · · + X n )′ = X 1 ′ X 2 ′ X 3 ′ . . .
X n ′ –------------>(2-25)
4.(X 1 X 2 X 3 . . . X n )′ = X 1 ′ + X 2 ′ + X 3 ′ + · · · +
X n ′ –----------->(2-26)
The inverse or complement
For n=3
1)(X 1 + X 2 + X 3 )′ = (X 1 + X 2 )′X′ 3 = X′ 1 X′ 2 X′ 3
2)DeMorgan’s laws can be stated as
1)The complement of the product is the sum of
the complements.
2)The complement of the sum is the product of
the complements.
3)To form the complement of an expression
containing both OR and AND operations,
DeMorgan’s laws are applied alternately.
Example 1
l
To find the complement of (A′ + B)C′, first apply
(2-13) and then (2-12).
l
[ (A′ + B)C′ ] ′ = (A′ + B)′ + (C′)′ = AB′ + C
l
Conversion parts:
l
- (A’ + B)’ = A’’B’ = AB’
Example 2
l
[(AB′ + C)D′ + E ]′ = [ (AB′ + C)D′ ]′ E′ ----- (by (2-
12))- remember (x+y)’ = x’y’
l
= [ (AB′ + C)′ + D ] E′ ---------- (by (2-13))
l
= [ (AB′)′C′ + D ] E′ ---------- (by (2-12))
l
= [ (A′ + B)C′ + D ] E′ ---------- (by (2-13)) (2-27)
l
Note that in the final expressions, the
complement operation is applied only to single
variables.
The inverse of F = A′B + AB′
l
F′ = (A′B + AB′)′ = (A′B)′(AB′)′ = (A + B′)(A′ + B)
l
= AA′ + AB + B′A′ + BB′ = A′B′ + AB
l
verify that this result is correct by constructing a
truth table for F and F′
l
Remember that AA’ = 1

You might also like