CPCS202 - The Lab Note

King Abdul Aziz University
Faculty of Computing and Info Tech
Computer Science Department
LAB MANUAL
CPCS 211
Digital Logic Design
Prepared By:
Aman Ullah
2012(1) - 1433
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Statement Purpose:
In this lab we shall discuss about the Canonical and Standard forms of Boolean functions, Sum of
Minterms, Product of Maxterms, Conversion of Boolean functions from one canonical form into another,
and expressing Boolean functions in Standard forms.
Activity Outcomes:
The students will learn about the Minterms and Maxterms of Boolean functions. They will be familiarized
with Canonical and Standard forms of Boolean functions. They will also know how to convert a Boolean
function from one form to another.
Instructor Note:
Read the lab notes carefully and thoroughly. All the examples have been solved in an easy to understand
manner. You should not find it difficult to learn the topics given in these lab notes. Try to solve all the
exercises yourself that are given at the end of notes. These exercises will certainly help you achieving the
objectives of this lab.
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Minterms:
 Consider two binary variables x and y combined with an AND operation. Since each
variable may appear in its normal form or in its complement form, therefore there are
four possible combinations: x’y’, x’y, xy’ and xy.
 Each of these four AND terms is called a Minterm or Standard Product.
 In a similar manner, n variables can be combined to form 2n Minterms.
 The 23 Minterms for 3 variables can be determined by the method described in the
following truth table.
 In case of Minterms, each primed variable is equal to 0 and each un-primed variable is
equal to 1.
 In case of Minterms, each AND term contains all the variables of the Boolean function
whether in their primed or un-primed form.
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Maxterms:
 In the similar fashion, n variables forming an OR term with each variable being
primed or un-primed provide 2n possible combinations, called Maxterms or Standard
Sum.
 The 23 Minterms for 3 variables can be determined by the method described in the
following truth table.
 In case of Maxterms, each primed variable is equal to 1 and each un-primed variable is
equal to 0.
 In case of Maxterms, each OR term contains all the variables of the Boolean function
whether in their primed or un-primed form.
 From the above truth tables, we note that each Maxterm is the complement of its
corresponding Minterm and vice versa.
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Representing a Boolean Function in Sum of Minterms or Product of Maxterms From a
Truth Table:
 If a Boolean function is represented by a truth table, and we want to write it in Sum of
Minterms, we combine all the Minterms against the 1’s of that function and take the
OR (i.e. +) of all those Minterms.
 Consider the following truth table representing two Boolean functions F1 and F2.
X
Y
Z
F1.
F2
0
0
0
0
0
0
0
1
1
0
0
1
0
0
0
0
1
1
0
1
1
0
0
1
0
1
0
1
0
1
1
1
0
0
1
1
1
1
1
1
 In order to represent F1 in Sum of Minterms, we write the Minterms against the 1’s of
F1.
 So, we write Minterms for 001, 100 and 111 which are x’y’z, xy’z’ and xyz (i.e.
represent each 0 by its corresponding primed variable and 1 by its corresponding
unprimed variable).
 Finally combining all the above Minterms using +s, we get F1 in Sum of Minterms as
F1 = x’y’z + xy’z’ + xyz
= m1 + m4 + m7
= ∑ (1, 4, 7)
 Similarly the function F2 can be represented in Sum of Minterms as
F2 = x’yz + xy’z+xyz’ + xyz (Writing Minterms for 011, 101, 110 & 111)
= m3 + m5 + m6 + m7
= ∑ (3, 5, 6, 7)
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
 Now, if we write Minterms against the 0’s of a Boolean function, it will give us
Complement of that Boolean Function.
 For example, if we write Minterms against the 0’s of the Boolean Function F1, we get
F1’ = x’y’z’ + x’yz’ + x’yz + xy’z + xyz’
F1 = (x’y’z’ + x’yz’ + x’yz + xy’z + xyz’)’
=(x’y’z’)’. (x’yz’)’ . (x’yz)’ . (xy’z)’ . (xyz’)’ [Using De Morgan’s Law]
=(x + y + z).(x + y’ + z’).(x + y’ + z’).(x’ + y + z’).(x’ + y’ + z)
= M0 . M2 . M3 . M5 . M6
= Π (0, 2, 3, 5, 6)
 Similarly, the function F2 can be represented in Product of Maxterms as
F2 = (x + y + z).(x + y + z’).(x + y’ + z).(x’ + y + z)
= M0 . M1 . M2 . M4
= Π (0, 1, 2, 4)
 We can write a function in Product of Maxterms form directly from the truth table by
writing Maxterms for each eombination of the variables which produces 0 in the
function and then combine all those Maxterms by AND (i.e. .) operation.
Representing a Boolean Function in Sum of Minterms
 In sum of Minterms form, each Minterm contains each and every variable in its
primed or un-primed form.
 It is sometimes convenient to express a Boolean function in Sum of Minterms form. If
a Boolean function is not represented in such form, it can be made so by first
expanding the expression into sum of AND terms.
 Each term is then inspected to see if it contains all the variables (either in primed or in
un-primed form).
 If it misses one or more variables, it is ANDed with an expression such as x + x’,
where x is one of the missing variables.
Example
Express the Boolean Function F = A + B’C in a Sum of Minterms form.
Solution:
The given function has three variables: A, B and C. The first term A is missing two variables
B and C. So we proceed as
A = A. (B + B’)
= AB + AB’
= AB.(C + C’) + AB’.(C + C’)
= ABC + ABC’ + AB’C + AB’C’
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
The second term B’C is missing one variable i.e. A. So, we proceed as
B’C = B’C.(A + A’)
= AB’C + A’B’C
So, the given function becomes
F = ABC + ABC’ + AB’C + AB’C’ + AB’C + A’B’C
= 111 + 110 + 101 + 100 + 101 + 001
= m7 + m6 + m5 + m4 + m5 + m1
= m1 + m4 + m5 + m6 + m7
= ∑ (1, 4, 5, 6, 7)
Representing a Boolean Function in Product of Maxterms
 To express the Boolean function as a product of Maxterms, it must first be brought
into a form of OR terms.
 This may be done by using the distributive law: x + yz = (x + y)(x + z)
 Then any missing variable say x, in each OR term is ORed with x.x’
Example
Express the Boolean function F = xy + x’z in a product of Maxterm form.
Solution
We shall first convert the given function into OR terms using the distributive law.
F = xy + x’z
= (xy + x’)(xy + z)
= (x’ + xy)(z + xy)
= (x’ + x)(x’ + y)(z + x)(z + y)
= (x’ + y)(x + z)(y + z)
[As x + x’ = 1]
This function has three variables: x, y and z. Each OR term is missing one variable. So, we
proceed as
x’ + y = (x’ + y) + z.z’
[As z.z’ = 0]
= (x’ + y + z)(x’ + y + z’)
x + z = (x + z) + y.y’
[As y.y’ = 0]
= (x + z + y)(x + z + y’) = (x + y + z)(x + y’ + z)
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
y + z = (y + z) + x.x’
[As x.x’ = 0]
= (y + z + x)(y + z + x’) = (x + y + z)(x’ + y + z)
Combining all these terms and writing repeating terms once, we get
F = (x’ + y + z)(x’ + y + z’)(x + y + z)(x + y’ + z)
= 100 . 101 . 000 . 010 (Representing each primed variable by 1 and unprimed variable by 0)
= M4 . M5 . M0 . M2
= Π(0, 2, 4, 5)
Conversion from one Canonical Form into Another
Consider a function F represented in Sum of Minterms form as
F(A, B, C) = ∑ (1, 4, 5, 6, 7)
Since the complement of any function (which is expressed in Sum of Minterms) is equal to
the Sum of those Minterms which are not present in the original function, therefore we can
write
F’(A, B, C) = ∑ (0, 2, 3)
Or
F’(A, B, C) = m0+m2+m3
Taking complement on both sides, we get
F(A, B, C) = (m0+m2+m3)’
= m0’. m2’. m3’
= M0 . M2 . M3 (As complement of every Minterm is equal to its
corresponding Maxterm)
= Π (0, 2, 3)
Which is equivalent function expressed in Product of Maxterms.
Note:
In order to convert one canonical form into another, interchange the symbols ∑ and Π and
list those numbers which are missing from the original form.
For example, if we have
F(x, y, z) = Π (1, 4, 6, 7)
then
F(x, y, z) = ∑ (0, 2, 3, 5)
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Standard Forms
When we express some Boolean function from truth table, we get it in one of the two
canonical forms. But these forms are not simplified ones because each Minterm or Maxterm
contains each and every variable either in primed or in un-primed form.
Another way to express Boolean functions is to use standard form. In this form, each term of
the function may contain one, two or any number of literals.
There are two types of standard forms:
(i)
Sum of Product
For example, the following function is expressed in Sum of Product form:
F = y’ + xy + x’yz’
It is similar to Sum of Minterms with one difference. In Sum of Minterms, each
term contains each and every variable whereas in Sum of Product, each term may
contain any number of variables.
(ii)
Product of Sum
For example, the following function is expressed in Product of Sum form:
F = x(y’ + z)(x’ + y + z’ + w)
It is similar to Product of Maxterms with one difference. In Product of Maxterms,
each term contains each and every variable whereas in Product of Sum, each term
may contain any number of variables.
Note:
A Boolean function may be expressed in a non-standard form. For example, the function
F = (AB + CD)(A’B + CD’)
is neither in Sum of Product nor in Product of Sum form. But it can be changed to a standard
form by using distributive law as
F = AB.A’B + AB.CD’ + A’B.CD + CD.CD’
= 0 + ABCD’ + A’BCD + 0
(As A.A’ = 0 and D.D’ = 0)
= ABCD’ + A’BCD (Sum of Minterms or Sum of Product form)
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
Example:
Express the following Boolean function in Sum of Minterms and a Product of Maxterms.
F(A, B, C, D) = D(A’ + B) + B’D
Solution:
Since
F(A, B, C, D) = D(A’ + B) + B’D
Therefore
F(A, B, C, D) = A’D + BD + B’D
The given Boolean function has four variables A, B, C and D. The first term is missing two
variables B and C, the second term is missing two variables A and C and the third term is
missing two variables A and C. So, we proceed as
A’D = A’D.(B + B’) = A’BD + A’B’D
=A’BD.(C + C’) + A’B’D.(C + C’) = A’BCD + A’BC’D + A’B’CD + A’B’C’D
BD = BD.(A + A’) = ABD + A’BD
=ABD.(C + C’) + A’BD.(C + C’) = ABCD + ABC’D + A’BCD + A’BC’D
B’D = B’D.(A + A’) = AB’D + A’B’D
=AB’D.(C + C’) + A’B’D.(C + C’) = AB’CD + AB’C’D + A’B’CD + A’B’C’D
Thus our given function can be rewritten by combining all the above terms as
F(A, B, C, D) = A’BCD + A’BC’D + A’B’CD + A’B’C’D + ABCD + ABC’D +
AB’CD + AB’C’D
= 0111 + 0101 + 0011 + 0001 + 1111 + 1101 + 1011 + 1001
= m7 + m5 + m3 + m1 + m15 + m13 + m11 + m9
= ∑ (1, 3, 5, 7, 9, 11, 13, 15)
Which is in Sum of Minterms form.
We know that the complement of any function, expressed in Sum of Minterms, is equal to
the sum of Minterms missing in the original function.
So F’(A, B, C, D) = ∑ (0, 2, 4, 6, 8, 10, 12, 14)
= m0 + m2 + m4 + m6 + m8 + m10 + m12 + m14
Taking complement on both sides, we get
F = (m0 + m2 + m4 + m6 + m8 + m10 + m12 + m14)’
= m’0 + m’2 + m’4 + m’6 + m’8 + m’10 + m’12 + m’14
= M0 + M2 + M4 + M6 + M8 + M10 + M12 + M14
CPCS-211 Digital Logic Design
Term
Spring 2012
Lab 4: Canonical and Standard Forms of Functions
= Π (0, 2, 4, 6, 8, 10, 12, 14)
Which is required Product of Maxterms form.
Exercises:
1. Express the following Boolean functions in Sum of Minterms and Product of
Maxterms forms
(i)
F(A, B, C) = (A’ + B)(B’ + C)
(ii) F(X, Y, Z) = (XY + Z)(Y + XZ)
2. Prove that dual of Exclusive-OR (of two variables) is equal to its complement.
3. Prove that Exclusive-OR and Equivalence operators are commutative and associative.
4. Prove that sum of all Minterms (of three variables) is equal to 1.
5. Prove that the product of all Maxterms (of three variables) is equal to 0.
6. A majority gate is a digital circuit whose output is equal to 1 if majority of inputs are
1’s. The output is 0 otherwise. By means of a truth table, find a Boolean function
implemented by a 3-input majority gate. Also simplify the function.
CPCS-211 Digital Logic Design