0% found this document useful (0 votes)
11 views56 pages

Lecture 2

Chapter 2 of fundamentals of logic circuit

Uploaded by

Yushi Shi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views56 pages

Lecture 2

Chapter 2 of fundamentals of logic circuit

Uploaded by

Yushi Shi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

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)

Constants (6, 1.4, pi, e,…) distributive law,


Variables (x, y, z, …) associative law,
Operators (+, -, x, …) commutative law,…

4
Introduction
 George Boole developed Boolean
algebra in 1847 and used it to solve
problems in mathematical logic.

 Claude Shannon first applied


Boolean algebra to the design of the
switching circuits in 1939.

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.

Two input circuits and a truth table

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 )

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


0 0 0 1 0 0 0 1 0
0 0 1 1 0 1 1 1 1
0 1 0 0 0 0 0 0 0
0 1 1 0 0 1 1 1 1
1 0 0 1 1 1 1 1 1
1 0 1 1 1 1 1 1 1
1 1 0 0 0 0 1 0 0
1 1 1 0 0 1 1 1 1

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)

X Y Z YZ X+YZ X+Y X+Z (X+Y)(X+Z)


0 0 0 0 0 0 0 0

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’

 Proof using a truth table


X Y X’ Y’ X+Y (X+Y)’ X’Y’ XY (XY)’ X’+Y’
0 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 0 0 1 1
1 0 0 1 1 0 0 0 1 1
1 1 0 0 1 0 0 1 0 0
19
DeMorgan’s Laws (2/3)
 n variables DeMorgan’s Laws
 (X1+X2+X3…+Xn)’=X1’X2’X3’…Xn’
 (X1X2X3…Xn)’=X1’+X2’+X3’+…+Xn’

 One-step rule for applying DeMorgan’s Laws

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:

(using one-step rule)

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

 Dual (Long solution)


 1. Complementing the entire expression.
 2. Complement each individual variable.

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

 (a   b )c[0  d  (1 e)]


Complement each

FD  (a  b)c[0  d  (1 e)] individual variable

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  BC

 Example: Simplify Z=(AB+C)(B’D+C’E’)+(AB+C)’


Sol:
Let ( AB  C)  Y and BD  CE  X , then
Z  ( AB  C )( BD  CE)  ( AB  C )
Z Y  X  Y
Z  X  Y  BD  CE  (AB  C)

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  ABB  B  A
BB’=0
Y  B A

The resulting circuit contains only one OR gate.

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  CDE  AC E is in SOP form.
Two variables ( A  B)CD  EF is not in SOP form.

 In degenerate cases, several sum terms may consist


of a single variable.

A  B  C  DE is 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.

( A  B)(C  D  E )( A  C   E ) is in POS form.


(A  B)(C  D)  EF is not in POS form.

 In degenerate cases, several product terms may


consist of a single variable.

ABC ( D  E ) is in POS form

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

 Sol-2: Use (X+Y)(X+Z)=X+YZ :

(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)

 Example: Factor AB’+C’D.


 Sol: AB’+C’D=(AB’+C’)(AB’+D)
=(A+C’)(B’+C’)(A+D)(B’+D)

 Example: Factor C’D+C’E’+G’H.


 Sol: C’D+C’E’+G’H = C’(D+E’)+G’H
=(C’+G’H)(D+E+G’H)
=(C’+G)(C’+H)(D+E’+G’)(D+E’+H)

35
Multiplying Out and Factoring Expressions (5/5)
 Example: Factoring (SOP => POS)
AC  ABD  ABE  AC 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 11  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

X Y 1 if and only if X=1 or Y=1 and X and Y are not


both 1 (X and Y are different).

37
Exclusive-OR (2/3)
 X  Y  X Y  XY 

 Theorems apply to exclusive OR:

38
Exclusive-OR (3/3)
 Proof of the distributive law X (Y  Z )  XY  XZ

 Proof:

XY  XZ  ( XY )' ( XZ)  ( XY )( XZ)'


 ( X 'Y ' )( XZ)  ( XY )( X 'Z ' )
 XY ' Z  XYZ'  X (Y ' Z  YZ ' )
 X (Y  Z )

39
Equivalence Operations (1/2)
 The equivalence operation  is defined by

 The truth table for X  Y is


A B X Y
0 0 1
0 1 0
1 0 0
1 1 1

(X Y) 1 if and only if X  Y .

40
Equivalence Operations (2/2)
 ( X  Y )  XY  X Y 

 Equivalence is the complement of exclusive-OR:


 ( X  Y )  ( X Y  XY )  ( X  Y )( X   Y )
 XY  X Y   ( X  Y )

 Alternate symbol for the equivalence gate

 The equivalence gate is also called an exclusive-NOR


gate.

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
AC D  ABD  BCD  ABC  ACD
 Sol-1:
AC D  ABD  BCD  ABC  ACD

(BD)(BC)  BCD
 AC D  ABD  ABC  ACD  4 terms.
 Sol-2:
AC D  ABD  BC D  ABC  AC D

(AD)(BD)  ABD (BC)(AC)  ABC


 AC D  BCD  ACD  3 terms.
43
The Consensus Theorem (3/3)
 Example: Simplify F  ABCD  BCDE  AB  BCE 
1 2 3 4

 Sol: Find consensus terms,


1&2 ABCD  BCDE  ABCD  BCDE  ACDE
1&3 ABCD  AB  ABCD  AB  (BCD)B  (ACD)A

2&4 BCD E  BC E   BCDE  BCE   (CDE )CE '  ( B ' CD ) BC

3&4 AB  BCE   AB  BCE   ACE 

 Add the consensus term ACDE to F.

Try to add A’CE’

44
Summary
 Boolean (Switching) expressions simplification

 Proving the validity of an Equation

 POS → SOP and SOP → POS

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.

4.Adding redundant terms:


 Adding xx y  y  xx 
 Multiply by ( x  x) y  y ( x  x)  yx  yx
 Adding yz to xy  xz xy  xz  xy  xz  yz
 Adding xy to x x  x  xy

47
Algebraic Simplification of Switching Expressions (3/4)
 Example: Simplify WX  XY  X Z   WY Z 
Consensus
 Sol: Theorem

 XW  X Z   XW  X ' Z 'WZ '


WX  XY  X Z   WY Z 
 WX  XY  X ' Z 'WY ' Z 'WZ ' X+XA=X

 WX  XY  X ' Z 'WZ ' First, check with three


basic theorems and

 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
ABCD  ABCD  ABD ABCD  ABCD ACD  BCD
 Sol:
ABC D  ABC D  ABD  ABC D  ABCD  ACD  BCD
A' C ' D ' A' BD
 A' C ' D ' A' BD  ABCD  ACD  BCD
 A' C ' D ' BD ( A' AC )  ACD  BCD 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.

 A' C ' D ' A' BD  ABC  B ' CD'

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.

Note: It is permission to perform the same reversible


operation on both sides of the equation. ( complement is
reversible; multiplication and addition are NOT reversible)
x+y=x+z does not imply y=z ( e.g. x=1,y=0, z=1)
xy=xz does not imply y=z ( e.g. x=0, y=0, z=1)
51
Proving Validity of an Equation (2/5)
 Example: Show that
ABD  BCD  ABC   ABD  BC D  AD  ABC
 Sol-1 (2nd method):

52
Proving Validity of an Equation (3/5)
 Example: Show that
ABD  BCD  ABC   ABD  BC D  AD  ABC
 Sol-2 (3rd method):
Let F1 ( A, B, C , D )  ABD  BCD  ABC   ABD
F2 ( A, B, C , D )  BC D  AD  ABC
(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   BD  B (CD  C )  BD
 B ( D  C )  BD  BD  BC   BD  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
ABC D  ( A  BC )( A  C D)  BC D  ABC 
 ABCD  AC 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:

Because both sides of the original equation were


independently reduced to the same expression, the
original equation is valid (3rd method).

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.”

You might also like