You are on page 1of 17

EEE3411 Electronics

│LECTURE 5│

Boolean Algebra

 Learning Objectives

Understand the rules of Boolean algebra and truth tables


and be able to use them to describe a simple engineering
problem

1. Boolean algebra

Boolean algebra differs in a major way from ordinary algebra in that


Boolean constants and variables are allowed to have only two possible
values, 0 or 1
In Boolean algebra there are only THREE basic operations:
OR ( + ), AND ( . ), NOT ( ‘ or x )

2. Truth tables

Fig 5-1 Truth tables or the logic operations

Week 1
© Vocational Training Council, Hong Kong
Boolean Algebraic Rules
Fundamental Laws
OR : (X+0) = X ; (X+1) = 1 ; (X+X) = X ; (X+X’) = 1
AND : (X)(0) = 0 ; (X)(1) = X ; (X)(X) = X ; (X)(X’) = 0
Associative Law
(X + Y) + Z = X + (Y + Z) ; (XY)Z = X(YZ)
Commutative Law
X+Y=Y+X; X.Y = Y.X
Distributive Law
X(Y + Z) = XY + XZ; (W + X)(Y + Z) = WY + XY + WZ + XZ
Auxiliary Identities
X(X + Y) = X + XY = X
X + YZ = (X + Y)(X + Z) = X + YZ + XY + XZ

Example
Show that A.B.(B.C + A’ )’ is equal to A.B.C’ by means of truth table.

Solution

The truth table for the left hand side expression is as shown in Figure
5-2. From the truth table, it can easily be seen that it is equal to
A.B.C’

Fig 5-2 Truth table for the given expression

Note: For simplicity, A .B is often written as AB.

2 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

Example
Show that A ( A’ + B ) = A + B by using truth table.

Solution

From the truth table shown in Figure 5-3, it is obvious that the given
statement is true.

Fig 5-3 Truth table for the given expression

DeMorgan’s Laws
These laws are frequently used.

Fig 5-4 DeMorgan’s laws

Week 3
© Vocational Training Council, Hong Kong
Verification of the DeMorgan’s law by truth table.

Fig 5-5 Verify the DeMorgan’s law

The rest of the DeMorgan’s laws may be verified in the similar way.

3. Derivation of SOP and POS expressions

To design a combinational logic circuit which produce logic high output


when its 3-digit binary input is higher than 210 :
First, fill up the truth table; input combinations and the corresponding
output.
Next, pick up these input combinations which produce logic high output
to form a Boolean expression.
Then, simplify the expression using the various laws of Boolean algebra

Fig 5-6 Formulation of Boolean equation

4 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

SOP Expression
The Boolean expression obtained in the translation method used in
previous example is known as SOP (Sum of Product) expression.
In the previous example, if F is the output, then
F = A’BC + AB’C’ + AB’C + ABC’ + ABC
Each product in a SOP is called a Minterm (or, standard product)

POS Expression
Another translation method is POS (Product of Sum). This is the
method by picking up all these input combinations which produce logic
low output (‘0’ or false state). For the previous example, F may be
written as
F’ = A’B’C’ + A’B’C + A’BC’
or F = [A’B’C’ + A’B’C + A’BC’]’
or F = (A + B + C)(A + B + C’)(A + B’ + C)
by applying the DeMorgan’s law.
So, a POS function is a AND product of OR sums.
Each sum in a POS is called a Maxterm (or, standard sum)

Minterm and Maxterm Tables


Minterm and maxterm table for two variables A and B:

Fig 5-7 Minterm and maxterm table for two variables A and B

Week 5
© Vocational Training Council, Hong Kong
Minterm and maxterm table for four variables A, B and C.

Fig 5-8 Minterm and maxterm table for three variables A, B and C

Minterm and maxterm table for four variables A, B, C and D.

Fig 5-9 Minterm and maxterm table for three variables A, B, C and D

6 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

4. Algebraic minimization

The Boolean functions may be simplified by using the laws of Boolean


algebra.

Example
Simplify the following Boolean expressions using the laws of Boolean
algebra.
(1) x + x’y
(2) (A’ + B + C + D)’ + (AB’C’D)
(3) (q + r) (q’ + r’)

Solution

(1) x + x’y
= x + x’y = (x + x’) (x + y)
= 1 . (x+y)
= x+y
(2) (A’ + B + C + D)’ + (AB’C’D)
= AB’C’D’ + AB’C’D
= AB’C’ (D’ + D)
= AB’C’
(3) (q + r) (q’ + r’)
= qq’ + rq’ + qr’ + rr’
= 0 + rq’ + qr’ + 0
= rq’ + qr’

Week 7
© Vocational Training Council, Hong Kong
More difficult examples are given below for further illustration.

Example
Simplify the following Boolean functions using the laws of Boolean
algebra.
(1) D = A’BC + AB’C + ABC + BC’
(2) W = Y’(X + Z) + Z(X’ + Y) + XZ
(3) F = A’C + A’B + AB’C + BC

Solution

(1) D = A’BC + AB’C + ABC + BC’


= A’BC + ABC + AB’C + ABC + BC’
= (A’ + A) BC + A(B’ + B) C + BC’
= BC + AC + BC’
= B + AC

(2) W = Y’(X + Z) + Z(X’ + Y) + XZ


= Y’X + Y’Z + ZX’ + ZY + XZ
= Y’X + Z(Y’ + X’ + y + X)
= Y’X + Z

(3) F = A’C + A’B + AB’C + BC


= A’B + A’C + AB’C + BC
= A’B + C ( A’ + AB’ + B)
= A’B + C ( A ’+ AB’ + B + AB’)
= A’B + C(A’ +B’ + B + A)
= A’B + C

8 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

5. Karnaugh map simplification

Simplifying the Boolean expressions using the laws of Boolean algebra


may sometimes be tedious, so for Boolean functions of variables less
than six, a handy tool known as Karnaugh map (K-map) may be used.

K-map is a map which shows the relation between the input and output of
a logic expression. It’s function is like a truth table.
Truth table uses ‘input’ and ‘output’ columns.
K-map uses ‘X-Y’ or ‘vertical-horizontal’ coordinates to represent a
specific combination of input and puts the corresponding output in that
coordinate, or, cell.
For a K-map to show logic AND, the cell AB shall be marked ‘1’, all
other cells be marked ‘0’.
Likewise, a K-map with ‘1’ in all cells except the cell A’B’ represents the
logic OR.
A K-map has 4 cells for 2 input variables, 8 cells for 3 and 16 cells for
four variables, etc. In our discussion, we will limit the number of
variables to four.

Fig 5-10 K-map for a Boolean function Y of two variables A and B

Week 9
© Vocational Training Council, Hong Kong
K-map for a Boolean function Y of three variables A , B and C.

Fig 5-11 K-map for a Boolean function Y of three variables A , B and C

K-map for a Boolean function Y of four variables A , B, C and D.

Fig 5-12 K-map for a Boolean function Y of four variables A , B, C and D

10 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

Constructing a K-map for a given function


The coordinates of a K-map is in gray code format, i.e. two adjacent
cells shall have only one variable changing. This is for easy grouping.
For example, if given a Boolean function of four variables A, B, C
and D as follow.
F = A’B’C’D’ + AB’C’D’ +
A’B’C’D + A’BC’D + AB’C’D +
A’B’CD + A’BCD + ABCD + AB’CD
A’B’CD’ + A’BCD’ + AB’CD’
Then picking up all the cells which have a ‘1’, we get the following
K-map.

For clarity, the cells with a value of zero are left blank.
Fig 5-13 K-map for the above given Boolean function F in SOP

Alternatively, picking up all cells which has a ‘0’, we have


F’ = A’BC’D’ + ABC’D’ + ABC’D + ABCD’
You may apply DeMorgan’s law to convert the above in POS form.

Fig 5-14 K-map for the above given Boolean function F in POS

Week 11
© Vocational Training Council, Hong Kong
Grouping in K-map
By grouping adjacent cells of same logic state together we can
simplify the logic expression.
Refer to the map shown in Figure 5-15.
Grouping TWO cells:
for example, A’B’C’D and A’BC’D in the 2nd row
F = .... + (A’B’C’D + A’BC’D) + ...
F = .... + (A’C’D) + ....
Grouping FOUR cells:
for example, A’B’CD, A’BCD, ABCD and AB’CD in the 3rd row
F = ....+ (A’B’CD + A’BCD + ABCD + AB’CD) + ....
F = .... + (A’CD + ACD) + ....
F = .... + (CD) + ....

Fig 5-15 Grouping in K-map for the above given Boolean function F

Final simplified map is shown in Figure 5-16..

Fig 5-16 Final simplified K-map for the above given Boolean function F

12 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

Example
Obtain the simplest SOP expression for the Boolean function F given in
Figure 5-17.

Fig 5-17 Example of K-map simplification

Solution

The simplest SOP expression for F is


F = A’ + B’C’ + B’D’
The grouping is shown in Figure 5-18.

Fig 5-18 Grouping in the example K-map simplification

Week 13
© Vocational Training Council, Hong Kong
Group Size versus Number of Variables in K-map
For a four variables K-map
․a 1-cell group concerns 4 variables
․a 2-cell group concerns 3 variables
․a 4-cell group concerns 2 variables
․a 8-cell group concerns 1 variable only

Rules of Grouping in K-map


․All 1’s (or 0’s) shall be picked up, don’t leave any cell unattended.
․As small number of group as possible
․Each group - as large as possible
․Groups can overlap
․Don’t create sub-group (a small group totally within a larger group)
․Depend on the distribution of ‘1’ & ‘0’, it may be better to pick up 0’s
to find F’

K-map with Multiple Equivalent Minimal Solutions


For a given K-map, sometimes there may be more than one
combination of groupings having the same number of total terms in the
expressions.

Example
Obtain all the possible equivalent minimal solutions for the K-map
given in Figure 5-19.

Fig 5-19 Example K-map with multiple equivalent minimal solutions

14 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

Solution

The equivalent minimal solutions are given in Figure 5-20 to 5-22.

Fig 5-20 Example K-map with multiple equivalent minimal solutions

Fig 5-21 Example K-map with multiple equivalent minimal solutions

Fig 5-22 Example K-map with multiple equivalent minimal solutions

Week 15
© Vocational Training Council, Hong Kong
Don’t Care Terms in Boolean Function
In some practical situations, certain combinations of inputs will not
occur and so their corresponding outputs are not important.
Hence, we don’t care that ‘output’ to be marked ‘0’ or ‘1’ in a K-map or
Truth Table. We may mark it as ‘x’ or ‘d’.
A don’t care term ‘x’ may be grouped with ‘1’ or ‘0’, thus, the logic
expression and the actual circuit can be simplified.
For example, consider the following door alarm system:
․signal A and B are from two door sensors, signal C is from a clock.
․signal C is high when the time is 5:00 pm to 9:00 am (non-office
hours).
․signal A is high when door A is opened, similarly does signal B.
․if any ONE door is opened during non-office hours, alarm shall be
activated
Say, door A and door B are interlocked such that they can’t be opened at
the same time. Therefore, the input combinations ABC and ABC’ will
not occur and thus are considered as don’t care.

Example
Find the minimal SOP expression for the function given in Figure 5-23.

Fig 5-23 Example K-map with don’t care terms

16 Week 1
© Vocational Training Council, Hong Kong
EEE3411 Electronics

Solution

The minimal SOP expression for the given function with don’t care
terms is given in Figure 5-24.

Fig 5-24 Solution for the example K-map with don’t care terms

 Revision

Week 17
© Vocational Training Council, Hong Kong

You might also like