Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

TOPIC 2

BOOLEAN ALGEBRA

Prepared by Chiang Yoke Yen(2019)


Boolean Expression and Function
 Boolean algebra deals with binary variables and logic operation.
 A Boolean Function is described by an algebraic expression
called Boolean expression which consists of binary variables, the
constants 0 and 1, and the logic operation symbols.

Prepared by Chiang Yoke Yen(2019)


Identities of Boolean Algebra

Prepared by Chiang Yoke Yen(2019)


Example 8: Prove A  A B  A  B
 Solution : Prove by using identities of Boolean algebra.
A  AB
 A 1  A B Identity law: A = A1

 A(1  B )  A B Null law: 1 = 1+B

 A  AB  A B Distributive law: A(1+B) = A+AB

 A  B( A  A ) Distributive law: AB+𝐴B


ҧ = B(A+𝐴)ҧ

 A B Inverse law: A+𝐴ҧ = 1

Prepared by Chiang Yoke Yen(2019)


Example 8: Prove A  A B  A  B
 We also can show the expressions are logical equivalence by
using truth table.

A B ഥB
𝑨 A+𝑨
ഥB A+B
0 0 0 0 0
0 1 1 1 1
1 0 0 1 1
1 1 0 1 1

Prepared by Chiang Yoke Yen(2019)


LOGIC GATES
 An electronic circuit used in computers to perform a logical operation on its
two or more input signals. There are six basic gates, the AND, NOT, NAND,
OR, NOR, and exclusive OR gates, which can be combined into more
complex gates.

Prepared by Chiang Yoke Yen(2019)


Example 3:Construct the logic gate for a
Boolean Expression

Prepared by Chiang Yoke Yen(2019)


Example 4: Construct the logic gate for
a Boolean Expression

Prepared by Chiang Yoke Yen(2019)


Example 5: Construct a truth table to
describe the logic gate.

Prepared by Chiang Yoke Yen(2019)


A

Example 6:Find the output of the logic


gate

𝐴ҧ
𝐴ҧ ∙ 𝐵

𝐴ҧ ∙ 𝐵 + 𝐴 ∙ 𝐵ത

𝐴 ∙ 𝐵ത
𝐵ത

Prepared by Chiang Yoke Yen(2019)


Example 7:Find the output of the logic
gate

0
1 1
0

Prepared by Chiang Yoke Yen(2019)


Minimization of Circuits
 The complexity of the digital logic gates that implement a
Boolean function is directly related to the complexity of the
algebraic expression from which the function is implemented, it
is preferable to have the most simplified form of the algebraic
expression.
 The process of simplifying the algebraic expression of a Boolean
function is called minimization.
 Minimization is important since it reduces the cost and
complexity of the associated circuit.
 For example, the function 𝐹 = 𝑥ҧ 𝑦𝑧 ҧ + 𝑥 𝑦ത can be minimized
ത + 𝑥𝑦𝑧
to 𝐹 = 𝑥𝑧
ҧ + 𝑥 𝑦.

Prepared by Chiang Yoke Yen(2019)


Minimization of Circuits
 The circuits associated with above expressions:

 It is clear from the above image that the minimized version of the expression takes a
less number of logic gates and also reduces the complexity of the circuit
substantially.
 Minimization is hence important to find the most economic equivalent
representation of a Boolean function.
 Minimization can
Prepared beYokedone
by Chiang Yen(2019) by using algebraic simplification or Karnaugh map (K-
map) method.
LOGICAL EQUIVALENCE

Prepared by Chiang Yoke Yen(2019)


 The logic gate of the expression can be minimized by
apply the identities of Boolean algebra or the Karnaugh
map (K-map).

Prepared by Chiang Yoke Yen(2019)


Karnaugh map (K-map)
 A Karnaugh Map is a graphical way of minimizing a Boolean expression
based on the rule of complementation.
 This method is usually applied only when the function involves six or fewer
variables.
 The Karnaugh map can also be described as a special arrangement of
a truth table.
 The diagram below illustrates the correspondence between the Karnaugh
map and the truth table for the general case of a two-variable problem.

Prepared by Chiang Yoke Yen(2019)


K-Maps – Rules of Simplification
 The Karnaugh map uses the following rules for the simplification of expressions
by grouping together adjacent cells containing ones.
 Groups may not include any cell containing a zero.

 Groups may be horizontal or vertical, but not diagonal.

Prepared by Chiang Yoke Yen(2019)


K-Maps – Rules of Simplification
 Groups must contain 1, 2, 4, 8, or in general 2n cells. That is if n = 1, a group will contain
two 1's since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.

Prepared by Chiang Yoke Yen(2019)


K-Maps – Rules of Simplification
 Each group should be as large as possible and may overlap.

 Groups may wrap around the table. The leftmost cell in a row may be grouped with the
rightmost cell and the top cell in a column may be grouped with the bottom cell.

Prepared by Chiang Yoke Yen(2019)


K-Maps – Rules of Simplification
Summary:
 No zeros allowed.
 No diagonals.
 Only power of 2 number of cells in each group.
 Groups should be as large as possible.
 Every “1” must be in at least one group.
 Overlapping allowed.
 Wrap around allowed.
 Fewest number of groups possible.

Prepared by Chiang Yoke Yen(2019)


Use K-map in two variables
 Example 9: Simplify the following expressions by using K-map.
a) 𝑍 = 𝑥𝑦 + 𝑥𝑦
ҧ
b) 𝑍 = 𝑥𝑦ത + 𝑥𝑦
ҧ
c) 𝑍 = 𝑥𝑦ത + 𝑥𝑦
ҧ + 𝑥ҧ 𝑦ത
 Solution:
a) 𝑍 = 𝑥𝑦 + 𝑥𝑦
ҧ
𝑦 𝑦ത The two adjacent ”1” are grouped together.
Through inspection it can be seen that
𝑥 1 variable x has its true and false form within
the group. So, 𝑍 = 𝑥 + 𝑥ҧ 𝑦. Since 𝑥 + 𝑥ҧ = 1,
𝑥ҧ 1 Hence, the minimized answer therefore is Z =
y.

Prepared by Chiang Yoke Yen(2019)


Use K-map in two variables
 Solution:
b) 𝑍 = 𝑥 𝑦ത + 𝑥𝑦
ҧ
𝑦 𝑦ത

𝑥 1 Since groups may be horizontal or vertical, but


not diagonal, so no “1” be grouped. Hence,
𝑥ҧ 1 the expression still remain as Z = 𝑥 𝑦ത + 𝑥𝑦.
ҧ

c) 𝑍 = 𝑥𝑦ത + 𝑥𝑦
ҧ + 𝑥ҧ 𝑦ത
𝑦 𝑦ത

𝑥 1 The RED group will obtain result 𝑥ҧ and BLUE


group will obtain result 𝑦.
ത Hence, the minimized
𝑥ҧ 1 1 answer is 𝑍 = 𝑥ҧ + 𝑦.

Prepared by Chiang Yoke Yen(2019)
Use K-map in three variables
 For a 3-variable Boolean function, there is a possibility of 8
output minterms. The general representation of all the
minterms using 3-variables is shown below.

Prepared by Chiang Yoke Yen(2019)


Use K-map in three variables
 Example 10: Simplify the following expressions by using K-map.
a) 𝑍 = 𝑥𝑦𝑧ҧ + 𝑥𝑦𝑧
ҧ + 𝑥𝑦ത𝑧ҧ + 𝑥ҧ 𝑦ത𝑧ҧ
b) 𝑍 = 𝑥𝑦𝑧
ത + 𝑥𝑦𝑧
ҧ + 𝑥𝑦ത𝑧ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥ҧ 𝑦ത𝑧ҧ
c) 𝐹 𝑥, 𝑦, 𝑧 = 𝑥 𝑦ത + 𝑥𝑦𝑧
ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥ҧ 𝑧ҧ
d) 𝐹 𝑥, 𝑦, 𝑧 = 𝑥𝑦 + 𝑥𝑧
ҧ + 𝑦𝑧
ത + 𝑥𝑧ҧ + 𝑥𝑦
ҧ 𝑧ҧ

 Solution:
a) 𝑍 = 𝑥𝑦𝑧ҧ + 𝑥𝑦𝑧
ҧ + 𝑥 𝑦ത𝑧ҧ + 𝑥ҧ 𝑦ത 𝑧ҧ
𝑦𝑧 𝑦 𝑧ҧ 𝑦ത𝑧ҧ 𝑦𝑧

𝑥 1 1 From the group can see that 𝑍 =


𝑥 + 𝑥ҧ y + 𝑦ത 𝑧ҧ . Hence, the
𝑥ҧ 1 1 minimization answer is 𝑍 = 𝑧.ҧ
Prepared by Chiang Yoke Yen(2019)
Use K-map in three variables
 Solution:
b) 𝑍 = 𝑥 𝑦𝑧
ത + 𝑥𝑦𝑧
ҧ + 𝑥𝑦ത𝑧ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥ҧ 𝑦ത𝑧ҧ
𝑦𝑧 𝑦 𝑧ҧ 𝑦ത𝑧ҧ 𝑦𝑧

From the red group, the result is 𝑦.

𝑥 1 1 From the purple group, the result is
𝑥𝑧ҧ . Hence, the expression can be
𝑥ҧ 1 1 1 simplified as 𝑍 = 𝑦ത + 𝑥𝑧.
ҧ

c) 𝐹 𝑥, 𝑦, 𝑧 = 𝑥 𝑦ത + 𝑥𝑦𝑧
ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥ҧ 𝑧ҧ = 𝑥 𝑦ത 𝑧 + 𝑧ҧ + 𝑥𝑦𝑧
ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥ҧ 𝑦 + 𝑦ത 𝑧ҧ
= 𝑥𝑦𝑧ത + 𝑥𝑦ത𝑧ҧ + 𝑥𝑦𝑧
ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥𝑦ҧ 𝑧ҧ + 𝑥ҧ 𝑦ത𝑧ҧ
𝑦𝑧 𝑦 𝑧ҧ 𝑦ത𝑧ҧ 𝑦𝑧
ത First, expand the expression become SOP form
in three variables.
𝑥 1 1
From the red group, the result is 𝑦.

From the purple group, the result is 𝑥.ҧ Hence,
𝑥ҧ 1 1 1 1 the expression can be simplified as 𝑍 = 𝑦ത + 𝑥.ҧ
Prepared by Chiang Yoke Yen(2019)
Use K-map in three variables
 Solution:
c) 𝐹 𝑥, 𝑦, 𝑧 = 𝑥𝑦 + 𝑥𝑧
ҧ + 𝑦𝑧
ത + 𝑥𝑧ҧ + 𝑥𝑦ҧ 𝑧ҧ
= 𝑥𝑦(𝑧 + 𝑧)ҧ + 𝑥(𝑦
ҧ + 𝑦)𝑧
ത + (𝑥 + 𝑥)ҧ 𝑦𝑧
ത + 𝑥(𝑦 + 𝑦)ത 𝑧ҧ + 𝑥𝑦 ҧ 𝑧ҧ
= 𝑥𝑦𝑧 + 𝑥𝑦𝑧ҧ + 𝑥𝑦𝑧
ҧ + 𝑥ҧ 𝑦𝑧
ത + 𝑥 𝑦𝑧
ത + 𝑥ҧ 𝑦𝑧
ത + 𝑥𝑦𝑧ҧ + 𝑥 𝑦ത𝑧ҧ + 𝑥𝑦ҧ 𝑧ҧ
𝑦𝑧 𝑦 𝑧ҧ 𝑦ത𝑧ҧ 𝑦𝑧

First, expand the expression
𝑥 1 1 1
become SOP form in three
variables.
𝑥ҧ 1 1 1
From the red group, the result is 𝑦.
From the purple group, the result is
𝑧 . Hence, the expression can be
simplified as 𝑍 = 𝑦 + 𝑧.

* Sum-of-Product (SOP) is a boolean expression consisting purely of Minterms


Prepared by Chiang Yoke Yen(2019)
(product terms)
EXERCISES
Exercise topic 2.docx

Prepared by Chiang Yoke Yen(2019)

You might also like