Lecture 2
Lecture 2
Boolean Algebra
Contents
Boolean Algebra
2.1 Introduction
2.2 Basic Operations
2.3 Boolean Expressions and Truth Tables
2.4 Basic Theorems
2.5 Commutative, Associative, and Distributive Laws
2.6 Simplification Theorems
2.7 Multiplying Out and Factoring
2.8 Demorgan’s Laws
2
Contents
Boolean Algebra
3.1 Multiplying Out and Factoring Expressions
3.2 Exclusive-OR and Equivalence Operations
3.3 The Consensus Theorem
3.4 Algebraic Simplification of Switching
Expressions
3.5 Proving the Validity of an Equation
3
Algebra?
Algebra
Constructors Rules
(Basic Laws)
4
Introduction
George Boole developed Boolean
algebra in 1847 and used it to solve
problems in mathematical logic.
5
Introduction
Boolean Algebra
A Boolean algebra consists of a set B together with
three operations.
• AND (Boolean product) operation.
• OR (Boolean sum) operation +
• NOT (complement) operation ’ ( ).
Each variable in the set B can take on only two
different values, “0” and “1”.
6
Basic Operations (1/3)
NOT (complement, inverse)
1' 0, 1 0
0' 1, 0 1
Inverter
X 1 if X 0 and X 0 if X 1
7
Basic Operations (2/3)
AND (Boolean product)
Omit the symbol “.”, A . B=AB
AND Gate
A B C=AB
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table
8
Basic Operations (3/3)
OR (Boolean sum)
OR Gate
A B C=A+B
0 0 0
0 1 1
1 0 1
1 1 1
Truth Table
9
Boolean Expressions
Order in which the operations are performed
Parentheses Complementation AND OR
Circuits for expressions
10
Truth Tables (1/2)
If an expression has n variables, the number of different
combinations of values of the variables is 2n. Therefore,
a truth table for n-variable expression will have 2n rows.
A B A’ F=A’+B
0 0 1 1
0 1 1 1
1 0 0 0
1 1 0 1
11
Truth Tables (2/2)
AB C ( A C )( B C )
12
Theorems (1/3)
Operations with 0 and 1
X+0=X
X+1=1
X.0=0
X.1=X
13
Theorems (2/3)
Idempotent Laws
X+X=X
X.X=X
Involution Law
(X’)’=X
Law of complementation
X+X’=1
X.X’=0
14
Theorems (3/3)
Commutative Laws
XY=YX
X+Y=Y+X
Associative Laws
(XY)Z=X(YZ)=XYZ
(X+Y)+Z=X+(Y+Z)=X+Y+Z
Distributive Laws
X(Y+Z)=XY+XZ
X+YZ=(X+Y)(X+Z)
15
Proof of Boolean Theorems (1/3)
By truth table
X+YZ=(X+Y)(X+Z)
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1
16
Proof of Boolean Theorems (2/3)
By basic laws (1): Prove that (X+Y)(X+Z)=X+YZ
17
Proof of Boolean Theorems (3/3)
By basic laws (2): Prove that (X+Y)(X+Z)=X+YZ
Left HS Right HS
X 0, ( 0 Y)( 0 Z) YZ 0 YZ YZ
X 1, ( 1 Y)( 1 Z) 1 1 1 1 YZ 1
Step 1: Subst. X=0 to both LHS and RHS, and show LHS=RHS
Step 2: Subst. X=1 to both LHS and RHS, and show LHS=RHS
Step 3: If step 1 and step 2 are valid, then the equation is verified
18
DeMorgan’s Laws (1/3)
DeMorgan’s laws
The complement of the product is the sum of the complements.
(XY)’=X’+Y’
The complement of the sum is the product of the complements.
(X+Y)’=X’Y’
x x x x
20
DeMorgan’s Laws (3/3)
Example: Find the complement of (AB’+C)D’+E
Sol-1:
(using theorem)
Sol-2:
21
Duality (1/4)
Given a Boolean expression, the dual is formed by
replacing AND with OR, OR with AND, 0 with 1, 1 with 0.
(Short solution)
0 1 1 0
22
Duality (2/4)
Example: Find the dual of F a b' c 1 d '(0 e)
Sol:
F a b ' c 1 d ' (0 e)
F ' (a ' b '') c ' [0 d '' (1 e ')] DM Law
23
Duality (3/4)
Theorem: Given that two Boolean expressions which
contains the same variables are equal, the duals are
equal.
F G F D G D.
24
Duality (4/4)
Example:
X(Y+Z)=XY+XZ X+YZ=(X+Y)(X+Z)
Proof:
F G: X( Y Z) XY XZ
F G: X( Y Z) XY XZ
DM Law
F G: X Y Z ( X Y )( X Z)
D D
F G : X YZ ( X Y )( X Z)
Complement each
individual variable
25
Simplification Theorems (1/4)
Useful Simplification Theorems
XY+XY’=X
(X+Y)(X+Y’)=X
X+XY=X
X(X+Y)=X
(X+Y’)Y=XY
XY’+Y=X+Y
26
Simplification Theorems (2/4)
Proof
XY+XY’=X(Y+Y’)=X.1=X
(X+Y)(X+Y’)=XX+XY+XY’+YY’=X+X(Y+Y’)+0=X
X+XY=X.1+XY=X(1+Y)=X.1=X
X(X+Y)=XX+XY=X+XY=X
(X+Y’)Y=XY+YY’=XY+0=XY
XY’+Y=(X+Y)(Y’+Y)=(X+Y).1=X+Y
27
Simplification Theorems (3/4)
Example: Simplify Z=(A+B’C+D+EF)[A+B’C+(D+EF)’]
Sol: Let A B ' C X and D EF Y , then
Z [ A B ' C D EF ][ A B ' C ( D EF )' ]
Z [ X Y ][ X Y' ]
Z X A BC
28
Simplification Theorems (4/4)
Example: Find the output Y of the following circuit and design a
simpler circuit with the same output.
AB’ AB’+(B+AB)
(AB’+(B+AB))B
B+AB
AB
Sol:
Y (AB (AB B))B A
AB+B=B
Y (AB B)B A
Distributive
Y ABB B A
BB’=0
Y B A
29
Sum-of-products (SOP) (1/2)
Sum-of-products (SOP)
An expression is said to be in sum-of-products form
when all products are the products of only single
variables.
AB CDE AC E is in SOP form.
Two variables ( A B)CD EF is not in SOP form.
30
Product-of-sums (POS) (2/2)
Product-of-sums (POS)
An expression is said to be in product-of-sum form
when all sums are the sums of only single variables.
31
Multiplying Out and Factoring Expressions (1/5)
Given an expression in POS form, the corresponding
SOP form can be obtained by multiplying it out.
X (Y Z ) XY XZ
( X Y )( X Z ) X YZ
( X Y )( X Z ) XZ X Y
Given an expression in SOP form, the corresponding
POS form can be obtained by factoring.
XY XZ X (Y Z )
X YZ ( X Y )( X Z )
XZ X Y ( X Y )( X Z )
32
Multiplying Out and Factoring Expressions (2/5)
Example: Multiply out (A+BC)(A+D+E).
Sol-1: Multiply out the original expression completely
and then eliminating redundant terms:
(A+BC)(A+D+E)=A+AD+AE+ABC+BCD+BCE
=A(1+D+E+BC)+BCD+BCE
=A+BCD+BCE
(A+BC)(A+D+E)=A+BC(D+E)=A+BCD+BCE
X Y X Z
33
Multiplying Out and Factoring Expressions (3/5)
Example: Multiplying out (POS => SOP)
( A B C )( A B D )( A B E )( A D E )( A C )
Sol: (X+Y)(X+Z)=X+YZ
(X+Y)(X’+Z)=XZ+X’Y
34
Multiplying Out and Factoring Expressions (4/5)
Example: Factor A+B’CD. X+YZ=(X+Y)(X+Z)
Sol: A+B’CD=(A+B’)(A+CD)
=(A+B’)(A+C)(A+D)
35
Multiplying Out and Factoring Expressions (5/5)
Example: Factoring (SOP => POS)
AC ABD ABE AC DE
Sol:
XZ+X’Y=(X+Y)(X’+Z)
X+YZ=(X+Y)(X+Z)
36
Exclusive-OR (1/3)
Exclusive-OR:
0 0 0 0 1 1
1 0 1 11 0
Truth table and gate for X Y
A B X Y 1
0 0 0
0 1 1
1 0 1
1 1 0
37
Exclusive-OR (2/3)
X Y X Y XY
38
Exclusive-OR (3/3)
Proof of the distributive law X (Y Z ) XY XZ
Proof:
39
Equivalence Operations (1/2)
The equivalence operation is defined by
40
Equivalence Operations (2/2)
( X Y ) XY X Y
41
The Consensus Theorem (1/3)
The consensus theorem:
XY X Z YZ XY X Z
Proof:
XY X Z YZ XY X Z 1 YZ
XY X ' Z ( X X ' )YZ
XY X ' Z XYZ X ' YZ
XY (1 Z ) X ' Z (1 Y )
XY X ' Z
The dual form
( X Y )( X Z )(Y Z ) ( X Y )( X Z )
42
The Consensus Theorem (2/3)
Example: Simplify
AC D ABD BCD ABC ACD
Sol-1:
AC D ABD BCD ABC ACD
(BD)(BC) BCD
AC D ABD ABC ACD 4 terms.
Sol-2:
AC D ABD BC D ABC AC D
44
Summary
Boolean (Switching) expressions simplification
45
Algebraic Simplification of Switching Expressions (1/4)
1.Combining terms:
Use the theorem XY XY X to combine two
terms.
2. Eliminating terms:
Use X XY X to eliminate redundant terms;
then try to apply the consensus theorem.
XY X Z YZ XY X Z
to eliminate any consensus terms.
46
Algebraic Simplification of Switching Expressions (2/4)
3.Eliminating literals:
Use the theorem X X Y X Y to eliminate
redundant literals.
47
Algebraic Simplification of Switching Expressions (3/4)
Example: Simplify WX XY X Z WY Z
Consensus
Sol: Theorem
WX XY X ' Z '
consensus theorem:
XY+XY’ = X
X+XY = X
X+X’Y=X+Y
If they don’t help,
YZ’
consider adding
48 redundant terms.
Algebraic Simplification of Switching Expressions (4/4)
Example : Simplify
ABCD ABCD ABD ABCD ABCD ACD BCD
Sol:
ABC D ABC D ABD ABC D ABCD ACD BCD
A' C ' D ' A' BD
A' C ' D ' A' BD ABCD ACD BCD
A' C ' D ' BD ( A' AC ) ACD BCD First, check with three
basic theorems and
A' C ' D ' BD ( A'C ) ACD' B ' CD' consensus theorem:
A' C ' D ' A' BD BCD ACD ' B' CD' XY+XY’ = X
A' C ' D ' A' BD BCD ACD ' ABC B ' CD' X+XY = X
X+X’Y=X+Y
ACD ' If they don’t help,
A' C ' D ' A' BD BCD ACD ' ABC B ' CD' consider adding
BCD redundant terms.
49
Simplification by using algebraic techniques
The procedures are challenging to apply
systematically.
It is difficult to tell when you have arrived at a
minimum solution.
50
Proving Validity of an Equation (1/5)
Determine if an equation is valid:
1. Construct a truth table and evaluate both sides of the
equation for all combinations of the values of the
variables.
2. Manipulate one side of the equation by applying various
theorems until it is identical to the other side.
3. Reduce both sides of the equation independently to the
same expression.
52
Proving Validity of an Equation (3/5)
Example: Show that
ABD BCD ABC ABD BC D AD ABC
Sol-2 (3rd method):
Let F1 ( A, B, C , D ) ABD BCD ABC ABD
F2 ( A, B, C , D ) BC D AD ABC
(1) A 0, F1 (0, B, C , D ) BD BCD B ( D CD ) B ( D C ) BD BC
F2 (0, B, C , D ) BC D BC B (C D C ) B ( D C ) BD BC
F1 (0, B, C , D ) F2 (0, B, C , D )
( 2) A 1, F1 (1, B, C , D ) BCD BC BD B (CD C ) BD
B ( D C ) BD BD BC BD D BC
F2 (1, B, C , D ) BC D D D BC
F1 (1, B, C , D ) F2 (1, B, C , D )
F1 ( A, B, C , D ) F2 ( A, B, C , D )
53
Proving Validity of an Equation (4/5)
Example: Show that
ABC D ( A BC )( A C D) BC D ABC
ABCD AC D ABD ABCD BC D
Sol: First, we will reduce the left side:
54
Proving Validity of an Equation (5/5)
Sol (cont.): Now we will reduce the right side:
55
End
“This lecture material has been produced and published expressly for lecture purposes in
support of a Yonsei University course. This material cannot be used for any other purposes
and cannot be shared with others. Individuals who violate these terms and restriction are
legally responsible for any violation of intellectual property laws.”