You are on page 1of 46

# BOOLEAN ALGEBRA

AND
LOGIC SIMPLIFICATION
1
Chapter 4
Contents
2
Boolean Algebra
De Morgan Theorem
Karnaugh Map
2 variables
3 variables
4 variables
5 variables
Dont care condition

Boolean Algebra
Boolean algebra is the mathematics of digital systems.
Terms used in Boolean algebra
A variable is a symbol used to represent a logical quantity. Any
single variable can have the value of 1 or 0.
The complement is the inverse of a variable and is indicated by a
bar over the variable. The complement of the variable A is A. If A=1,
then A =0. Sometimes a prime symbol is used to denote a
complement of a variable, A .
A literal is each appearance of a variable or its complement.
For example, F (X ,Y ,Z) = XY(Z + YX) + YZ:
3 Variables
7 Literals

3
Laws of Boolean Algebra
4
Commutative Law
Addition: A + B = B + A

Multiplication : AB = BA

A
B
X
B
A
X
A
B
X
B
A
X

Laws of Boolean Algebra (cont.)
5
Associative Law
Addition: A + (B + C) = (A + B) + C

Multiplication: A(BC) = (AB)C

A
B
C
C
A
B

A
B
C

A
B
C
Laws of Boolean Algebra (cont.)
6
Distributive Law
A(B + C) = AB + AC

A
B
C
C
A
B

Rules of Boolean Algebra
7
1. A + 0 = A
2. A + 1 = 1
3. A 0 = 0
4. A 1 = A
5. A + A = A
6. A + A = 1
7. A A = A
8. A A = 0
9. (A) = A
10. A + AB = A
11. A + AB = A + B
12. (A+B)(A+C)=A+BC
Rules of Boolean Algebra (cont.)
8
1. A + 0 = A

2. A + 1 =1
A=0
0
0
A=1
0
1
A=0
1
1
A=1
1
1
Rules of Boolean Algebra (cont.)
9
3. A 0 = 0

4. A 1 =A
A=0
0
0
A=1
0
0
A=0
1
0
A=1
1
1
Rules of Boolean Algebra (cont.)
10
5. A + A = A

6. A + A = 1
A=0
A=0
0
A=1
A=1
1
A=0
A=1
1
A=1
A=0
1
Rules of Boolean Algebra (cont.)
11
7. A A = A

8. A A =0
A=0
A=0
0
A=1
A=1
1
A=0
A=1
0
A=1
A=0
0
Rules of Boolean Algebra (cont.)
12
9. (A) = A

A=0 A=1 (A)=0
A=1 A=0 (A)=1
Rules of Boolean Algebra (cont.)
13
10. A+AB = A

11. A+ AB = A + B

A + AB = A 1 + AB
= A (1 +B)
= A 1
= A
A + AB = (A + AB) + AB
= A + B(A +A)
= A + B 1
= A + B
Rules of Boolean Algebra (cont.)
14
12. (A + B)(A + C) = A + BC

(A+ B)(A + C) = AA + AC + AB + BC
= A + AC + AB + BC
= A (1 +C) + AB + BC
= A 1 + AB + BC
= A(1 + B) + BC
= A 1 + BC
= A + BC
DeMorgans Theorem
1. XY = X + Y

2. X + Y = X Y
15
NAND
Negative-OR
NOR Negative-AND
DeMorgans Theorem Examples
Apply DeMorgans theorem for WXYZ.

16
WXYZ = W + X + Y + Z
DeMorgans Theorem Examples
Apply DeMorgans Theorem for (A+B+C)D
Let (A+B+C) = X, and D =Y
Applying DeMorgans Theorem

(A+B+C)D= A+B+C + D

Applying DeMorgans Theorem for first term

A+B+C + D = A B C + D

17
Simplification Using Boolean Algebra
AB + A(B+C) + B(B+C)
= AB + AB + AC + BB + BC
= AB + AC + B + BC
= AB + AC + B
= B + AC
18
Apply distributive law

BB=B (R7); AB+AB=AB (R5)

B+BC = B (R10)

B+AB = B (R10)
A
B
C
A
B
C
AB + AC +ABC
= (AB)(AC) + ABC
= (A+B)(A+C) + ABC
= AA+AC+AB+BC+ABC
= A + AC + AB + BC
= A + AB + BC
= A + BC
Simplification Using Boolean Algebra
19
Apply DeMorgans Theorem

Apply DeMorgans Theorem

Apply Distributive Law

AA=A (R7); AB+ABC=AB (R10)

A+AC=A (R10)

A+AB=A (R10)

SOP vs POS
Sum-of-Products (SOP)
Two or more product terms are summed by Boolean addition.
Implemented by ORing the outputs of two or more AND gates
For e.g., ABC+CDE+BCD
If any of the product-term is HIGH, then output is HIGH
Product-of-Sums (POS)
Two or more sum terms are multiplied by Boolean multiplication.
Implemented by ANDing the outputs of two or more OR gates
For e.g., (A+B)(A+B+C)
If any of the sum-term is LOW, then output is LOW

20
Canonical Forms of Boolean Algebra
Also known as, Standard form
Longest form of Boolean Expressions
All variable appears in each sum/product terms
21
Canonical Forms of Boolean Algebra (cont.)
Minterms Standard Sum-of-Products (SOP)
All variables appear in each product terms
Output is HIGH if any product-term is HIGH
22
Binary Equivalent
(ABC)
Minterm Minterm
Number
000 ABC m
0
001 ABC m
1

010 ABC m
2

011 ABC m
3

100 ABC m
4

101 ABC m
5

110 ABC m
6

111 ABC m
7

Note:
0 bar
1 no bar
Canonical Forms of Boolean Algebra (cont.)
For eg; X(A,B,C) = m(0, 2, 3, 5)
=m
0
+ m
2
+ m
3
+ m
5
=ABC + ABC + ABC + ABC

23
Binary (ABC) X
000 1
001 0
010 1
011 1
100 0
101 1
110 0
111 0
Canonical Forms of Boolean Algebra (cont.)
Maxterms Standard Product-of-Sums (POS)
All variables appear in each sum terms
Output is LOW if any sum-term is LOW

24
Binary Equivalent
(ABC)
Maxterm
000 (A+B+C) M
0
001 (A+B+C) M
1

010 (A+B+C) M
2

011 (A+B+C) M
3

100 (A+B+C) M
4

101 (A+B+C) M
5

110 (A+B+C) M
6

111 (A+B+C) M
7

Note:
1 bar
0 no bar
Canonical Forms of Boolean Algebra (cont.)
For eg; X (A, B, C) = M(1, 2, 6, 7)
= M
1
M
2
M
6
M
7
=(A+B+C)(A+B+C)(A+B+C)(A+B+C)

25
Binary (ABC) X
000 1
001 0
010 0
011 1
100 1
101 1
110 0
111 0
Karnaugh Map
26
The Karnaugh map provides a systematic method for
simplifying Boolean expressions in SOP or POS form

The Karnaugh map is an array of cells in which each
cell represents a binary value of the input variables.

A Karnaugh map is similar to a truth table as it
presents all the possible values of input variables and
the resulting output for each value.

The number of cells is equal to the total number of
possible input variable combination, 2
n
.

The 2-variables Karnaugh Map
27
Is an array of 2
2
= 4 cells
Truth table

A B Minterm
0 0 m0
0 1 m1
1 0 m2
1 1 m3
AB AB
AB AB
0
0 1
1
A
B
The 3-variables Karnaugh Map
28
is an array of eight cells.

The 4-variables Karnaugh Map
29
is an array of sixteen cells.

Cell adjacency
30
The cells in a Karnaugh Map are arranged so that
there is only a single-variable change between
adjacent cells.
Adjacency is defined by a single-variable change.
Each cell is adjacent to the cells that are
immediately next to it on any of its four sides.
The cells in the top row are adjacent to the
corresponding cells in the bottom row . The cells in
the outer left column are adjacent to the cells in the
outer right column. This is called the wrap-around
adjacency.

31
K-map Mapping
32
Example 1: Map the standard SOP function below on
a K-map

f(a,b,c) = m(0, 5, 7)
= abc + abc + abc

abc
abc
abc
1
1 1
K-map Simplification
33
SOP expression; Boolean expression must be
presented in standard SOP form.
Map 1s on the minterm cells that make the standard
expression
Perform next 3 steps to simplify the expression:
1. Grouping the 1s
2. Determining the product term for each group
3. Summing the resulting product terms

K-map simplification (cont.)
34
Grouping the 1s:
Enclose adjacent cells containing 1s.
A group must contain either 1, 2,4,8 or 16 cells. Maximize the
size of the groups to minimize the number of groups .
Each 1 on the map must be included in at least one group.
The 1s already in a group can be included in another group as
long as the overlapping groups include noncommon 1s.
Determining the product terms:
Determine product terms for each group
Check variables that do not change for all the 1s in each group
35
Example 2: Use K-map to simplify the following SOP
expression

F(A,B,C,D) = ABCD + ABCD + ABCD + ABCD + ABCD
+ ABCD + ABCD + ABCD + ABCD + ABCD
36
1
1
1
1
1 1
1
1
1 1
The domains
that have
different values
are A,B and C.
thus this group
give the
simplified
expression of
D.
The domains
that remain
their values are
B and C. thus
this group give
the simplified
expression of
BC.
F (A,B,C,D) = BC + D
Exercises
37
1. Simplify the Boolean function:
f(x,y,z) = m(2,3,4,5)

2. Simplify f(x,y,z)= m(3,4,6,7) using K-map.

3. Express the expression f = AC + AB + ABC + BC in
sum of minterms using K-map . Then determine the
minimal SOP form of the expression.

4. Map the function f(A,B,C,D) = (A+C)(B+C)(B+C+D)
on a K-map and determine its minterm and maxterm
list form.

Exe. 3: Express the expression f = AC + AB + ABC + BC in sum of minterms
using K-map . Then determine the minimal SOP form of the expression.
38
Exe. 4: Map the function f(A,B,C,D) = (A+C)(B+C)(B+C+D)
on a K-map and determine its minterm and maxterm list form.
39
2 ways to accomplish this task:
1. Express the complement of the function in SOP form , map
the 1s and determine the minterms and maxterms from the
K-map cells.

2. Plot 0s on a K-map following the POS expression and
determine the maxterms & minterms from the K-map cells.

1. Express the complement of the function in SOP form , map the 1s and
determine the minterms and maxterms from the K-map cells.
40
f '(A,B,C,D) = [(A+C)(B+C)(B+C+D)]
= (A+C) + (B+C) + (B+C+D)
= AC + BC + BCD
0 1 3 2
4 5
12
8 9
13
11
15
7 6
14
10
1 1
1 1
1 1
1
1
Complement
1. Express the complement of the function in SOP form , map the 1s and
determine the minterms and maxterms from the K-map cells.
41
f (A,B,C,D) = (AC + BC + BCD)
0 1 3 2
4 5
12
8 9
13
11
15
7 6
14
10
0 0
0 0
0 0
0
0
Complement
0 1 3 2
4 5
12
8 9
13
11
15
7 6
14
10
2. Plot 0s on a K-map following the POS expression and determine the
maxterms & minterms from the K-map cells.
42
f (A,B,C,D) = (A+C)(B+C)(B+C+D)
0 0
0 0
0 0
0
0
f = M (0,1,4,5,6,8,9,14)

= m (2,3,7,10,11,12,13,15)

The 5-variables K-Map
43
Is a 32 cells map.

Let a function be of domain A,B,C,D,E

The 32 cells K-map is presented by 2 4-variables
map. Each of the map has a fixed domain value for
each cells, e.g. A=0 and A=1
Dont Care Condition
44
The logical sum of the minterms associated with a
Boolean function specifies the conditions under which
the function is equal to 1. the function is 0 for the rest of
the minterms.

However, there are applications where the function is
not specified for certain combinations of the variables.
E.g. BCD code use only 10 minterms. Other 6 minterms
are unused (m
10
m
15
).

These unspecified minterms is called dont care
conditions, as we dont care what are the values

45
These dont care conditions can be used on K-map
to provide further simplification of the Boolean
expression.

The dont cares minterms are marked with d or X
on the K-map, and can take any values of 1 or 0 if
needed to simplify an expression
46
Example: Simplify the following Boolean function:
f (A,B,C,D) = m ( 1,3,7,11,15) + d (0,2,5)

f(A, B, C, D) = M(4, 6, 8, 9, 10, 12, 13, 14)
0 1 3 2
4 5
12
8 9
13
11
15
7 6
14
10
1 1
1
1
1
d d
d
f (A,B,C,D) = AB + CD
0
0
0
0
0
0
0
0
f (A,B,C,D) = (A+ C) D