DBM20083
Discrete Mathematic
CHAPTER 2 : BOOLEAN ALGEBRA
Azlina Binti Morshidi/JMSK/PKS
Chapter 2 : Boolean Algebra
Boolean Function
Logic Gates
Minimize of the circuits
Azlina Binti Morshidi/JMSK/PKS
Introduction : Boolean Algebra
Boolean algebra provides the operations and the
rules for working with the set {0,1}.
Three operations in Boolean algebra that most
use are
Complementation
Boolean sum
Boolean product
Azlina Binti Morshidi/JMSK/PKS
Introduction : Boolean Algebra
The complement of an element, denoted with a
bar , is defined by 0ത = 1 1ത = 0.
The Boolean sum, is denoted by + or by OR,
has the following values:
1+1 = 1
1+0 = 1
0+1 = 1
0+0 = 0
Azlina Binti Morshidi/JMSK/PKS
Introduction : Boolean Algebra
The Boolean product, is denoted by . or by
AND, has the following values:
1.1 = 1
1.0 = 0
0.1 = 0
0.0 = 0
Azlina Binti Morshidi/JMSK/PKS
Introduction : Boolean Algebra
Example:
1.0 + 0 + 1
Using the definitions of complementation, the
Boolean Sum and Boolean Product, it follows that
1.0 + 0 + 1 = 0 + 1ത
=0+0=0
Azlina Binti Morshidi/JMSK/PKS
Introduction : Boolean Algebra
The complement, Boolean sum and Boolean
Product correspond to the logical operations, ~,∨
∧ respectively where 0 corresponds to
F(false) and 1 corresponds to T(True).
Example: Translate 1.0 + 0 + 1 = 0 into a logical
equivalence. We obtain
∧ ∨ ~ ∨ =
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
A Boolean expression is a logical statement that evaluates
to a Boolean value either TRUE or FALSE. Boolean value
(TRUE or FALSE) are logical connective combine together
to form a Boolean expression. A Boolean function is
represented by a Boolean expression.
A Boolean value is produced by an Boolean expression.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
For example, the equality operator, ==, compares two
values and produces a Boolean value related to whether the
two values are equal to one another.
Example : print(5==5)
This statement evaluated to TRUE since the two
operands are equal.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
Six common comparison operators:
• == ,
• ! = ,
• < , ℎ
• > , ℎ
• < = , ℎ
• > = , ℎ
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
Logical operators are:
! Logical negation
&& Logical AND
|| Logical OR
Logical operator operates on Boolean variables or
Boolean expression only.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
Example :
• Evaluate the following Boolean expression, given the
following declarations and assignments.
Boolean p=TRUE
Boolean q = FALSE
Boolean r = FALSE
&& ||
&& ||
||
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
Example :
• Evaluate the following Boolean expression, given the
following declarations and assignments
Boolean p = TRUE
Boolean q = FALSE
Boolean r = FALSE Try this!!!
! || &&
! ( && )||(! || )
||
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean
function
Example :
• Evaluate the following Boolean expression, given the
following declarations and assignments
Int j=12;
Int k = 15;
Int 4; Try this!!!
− > ||( == 1&& > 3)
! ( − 10 > 4 − )
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.1 Define Boolean Expression and Boolean function
Example : Find the values of the Boolean function
represented by = , , + ҧ
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Sum of Products (SOP) & Product of Sums (POS)
The different forms of canonical expression which includes
the sum of products (SOP) and products of sum (POS)
The canonical expression can be defined as a Boolean
expression which has either min term otherwise max term.
For example, if we have two variables X and Y, then the
canonical expression comprising of min terms will be +
′ ′, whereas the canonical expression comprising the max
terms will be ( + )( ′ + ′)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Sum of Products (SOP) & Product of Sums (POS)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Sum of Products (SOP)
SOP, one kind of Boolean algebra expression.
Different product inputs are added together.
The product of inputs is Boolean logical AND whereas the
sum or addition is Boolean logical OR.
First, what is minterm? When the minimum combinations
of inputs are high then the output will be high. Example,
combinations of AND gate inputs.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Sum of Products (SOP)
The truth table of the min term is shown below:
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Types of Sum of Products (SOP)
Three different forms:
Canonical SOP
Can be formed with grouping the minterms of the function for
which the output is high or true, and it is also called as the
sum on minterms.
The expression of the canonical SOP is denoted with sign
summation (∑), and the minterms in the bracket are then wh
en the output is true.
Non-canonical SOP
Minimal SOP
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Canonical SOP
From the table, the canonical SOP form
can be written as = σ( 1, 2, 3, 5)
By expanding the above summation, we
can get the following function = 1 +
2 + 3 + 5
By substituting the minterms in the above
equation, we get the expression =
′ ′ + ′ ′ + ′ + ′
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Non-Canonical SOP
Here, we simplified the product terms.
For example, the expression =
′ ′ + ′ ′ + ′ + ′ =
′ ′ + ′ ′ ′ + +
′ = ′ ′ +
′ + ′
This is still in the form of SOP but it is
non-canonical SOP form.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Product of Sums (POS)
A Boolean expression consisting
purely of maxterm (sum terms) is said
to be a canonical product of sums form.
For example, we have a Boolean
function F defined A and B. So, A and
B are the inputs for F and lets say,
output of F is true i.e F=1 when only
one of the input is true of 1. Now we
draw the truth table for F.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Product of Sums (POS)
Now, we will create a column for the
maxterm using the variables A and B. If
input is 1, we take the complement of
the variable and if input is 0 we take the
variable as is.
To get the desired canonical POS
expression we will multiply the
maxterms (sum terms) for which the
output is 0 (POS form is used when the
output is ‘0’)
= ( + )( ′ + ′)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Product of Sums (POS)
First, we need to denote the
maxterms in shorthand notation.
+ = 0
′ + ′ = 3
So, = 0 + 3
This also can be written as =⊓
(0,3)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.2 Use Identities of Boolean
In mathematics, and identity is a statement true for all
possible values of its variables or variables. The algebraic
identity of x + 0 = x tells us that anything (x) added to zero
equals the original ‘anything” no matter what value that
“anything “ (x) may be . Like ordinary algebra, Boolean
algebra has its own unique identities based on the bivalent
states of Boolean variables.
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.2 Use Identities of Boolean
Basic Boolean Algebraic Identities
Additive Multiplicative Inverter
+ 0 = A 0 = 0 0ത = 1
+ 1 = 1 1 = 1ത = 0
+ = = Ӗ =
+ ҧ = 1 ҧ = 0
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.2 Use Identities of Boolean
Identity Name AND Form OR Form
Identity Law 1 = 0 + =
Null (Dominance) Law 0 = 0 1 + = 1
Idempotent Law = + =
Inverse Law ҧ = 0 + ҧ = 1
Commutative Law = + = +
Associative Law = ( ) + + = + ( + )
Distributive Law + = ( + )( + ) + = +
Absorption Law + = + =
DeMorgan’s Law = ҧ + ത + = ҧ ത
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
2.1.2 Use Identities of Boolean
Identity Name
Unit Property + ҧ = 1
Zero property ҧ = 0
Complement Law ҧ =
+ ҧ =
ത =
ത =
Double Complement Law Ӗ =
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Example
Simplify the following expressions by using identities of
Boolean Algebra.
a = ഥ + ഥ ഥ c = ഥ + . ( + ഥ )
b = ( ഥ + )( + ) d = + ഥ .
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Solution
a = ഥ + ഥ ഥ
= ഥ + ഥ (Distributive Law)
= ഥ . (Inverse Law)
= ഥ (Identity Law)
b = ( ഥ + )( + )
= ഥ . ( ഥ . ) (D’Morgan Law)
= ഥ . ( ന + ഥ ) (D’Morgan Law)
= ഥ . ( + ഥ ) (Double Complement Law)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Solution
c = ഥ + . ( + ഥ )
= ( ഥ + ) + ( + ) (D’Morgan Law)
= ന . + ( ഥ . ന ) (D’Morgan Law)
= ഥ + ഥ (Double Complement Law)
d = + ഥ .
= ഥ . ((Distributive Law)
= + ഥ + + (Inverse and Idempotent Law)
= ഥ + + (Distributive Law)
= (Dominance Law)
= (Identity Law)
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Simplify the following expressions by using
identities of Boolean Algebra
a = ഥ + ഥ
b = ഥ ഥ ഥ + ഥ ഥ ഥ ഥ
c = + . ഥ
d = ഥ + ഥ
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Simplify the following expressions by using identities of
Boolean Algebra
a = ഥ + ഥ
b = ഥ ഥ ഥ + ഥ ഥ ഥ ഥ
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Simplify the following expressions by using identities of
Boolean Algebra
c = + . ഥ
d = ഥ + ഥ
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Exercise 1 :Simplify the following expressions by
using identities of Boolean Algebra
a = + h = ഥ + + ( + )( + ഥ )
b = ( + )( + ) I = + ഥ + ഥ ഥ + ഥ
c = + . ( + ) j = ഥ ഥ ഥ + ഥ ഥ + ഥ ഥ
d = ( ഥ + )( + + ) ഥ k = ഥ + + ഥ ഥ
e = + ഥ + ഥ l = +
f = ( ഥ + )( ഥ + ) m = ( ഥ + )( ഥ + )
g = + + + + n = + ( + )
o = ( ഥ ഥ )( + )
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
2.1.1 Define Logic Gates
A logic gate is an elementary building block of a digital circuit.
Most logic gates have two inputs and one output.
At any given moment, every terminal is in one of the two
binary conditions low(0) or high(1), represented by different
voltage levels. The logic state of a terminal can and
generally does, change often as the circuit processes data.
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
2.1.2 Construct Combination of Gates
Any logic circuit no matter how complex can be completely
described using the three basic Boolean operations because
the OR gate, AND gate and NOT circuit are the basic
building blocks of digital systems.
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
1. Draw the logic circuit to implement the following Boolean
Expressions:
a. = ( + ) c. = ( + )( ത + )
b. = ∙ + d. = + ҧ + ҧ
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
1. Draw the logic circuit to implement the following Boolean
Expressions:
a. = ( + ) b. = ∙ +
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
1. Draw the logic circuit to implement the following Boolean
Expressions:
c. = ( + )( ത + ) d. = + ҧ + ҧ
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
2. Write the Boolean expression for output x for each of the
following circuit diagrams:
a. b.
= ഥ + = +
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
2. Write the Boolean expression for output x for each of the
following circuit diagrams:
a. b.
= ഥ ( + ) = [ + ( + ) ] ∙
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
Draw the logic circuit to implement the following Boolean
Expressions:
a. = ത b. = ( + ) ⋅
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
Draw the logic circuit to implement the following Boolean
Expressions:
a. = ҧ ( + ) b. = [ + ( + ) ] ⋅
Azlina Binti Morshidi/JMSK/PKS
2.2 Logic Gates
Example
Write the Boolean expression for output x for each of the
following circuit diagrams,
a. b.
= ഥ + + + = + ⋅ +
Azlina Binti Morshidi/JMSK/PKS
2.1 Boolean Function
Exercise 2 :Draw the logic circuit to implement
the following Boolean Expressions,
Azlina Binti Morshidi/JMSK/PKS
Azlina Binti Morshidi/JMSK/PKS
Azlina Binti Morshidi/JMSK/PKS