0% found this document useful (0 votes)
26 views34 pages

Logic Design - Unit 2 20220803

Uploaded by

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

Logic Design - Unit 2 20220803

Uploaded by

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

UNIT 2

BOOLEAN ALGEBRA

SLIDE CREDIT: JIUN-IN GUO, H.-R. JIANG


Boolean Algebra
2
 Contents
 Introduction
 Basic operations

 Boolean expressions and truth tables


 Theorems and laws

 Basic theorems
 Commutative, associative, and distributive laws
 Simplification theorems
 Multiplying out and factoring
 DeMorgan’s laws

Boolean Algebra
Introduction
3
 Boolean algebra
 Is the basic mathematics for logic design of digital systems

 Differs from ordinary algebra in the values, operations, and laws

 In this unit, you will learn how to…


 Use a truth table

 Manipulate basic operations and apply laws of Boolean algebra

 Relate Boolean expressions to basic logic gates

Boolean Algebra
Introduction
4
 History
 George Boole developed Boolean algebra in 1847 and

used it to solve problems in mathematical logic


 British mathematician and philosopher

 Claude Shannon first applied Boolean algebra to the 1815~1864


design of switching circuits in 1939
 American electrical engineer and mathematician
 Master's thesis (21 years-old)

1916~2001
Boolean Algebra
Switching Circuit & Boolean Variables
5
 A switching circuit has one or more inputs and one or more outputs that take on
discrete values (two-value in general)
X1 Z1
X2 . . Z2
Inputs . Switching circuit . Outputs

Xm . . Zn

 We usually use a Boolean variable, such as X, Y, Z, to represent an input or output of


a switching circuit
 Usually take on only two different values

 1/0 for High/Low or True/False or Yes/No

 Just symbols, NO numeric values


 A two-value Boolean variable is also called a switching variable

Boolean algebra differs


from ordinary algebra in
values, operations, laws
Boolean Algebra
Boolean algebra differs
from ordinary algebra in
values, operations, laws

6 Basic Operations

NOT, AND, OR

Boolean Algebra
Operation -- Logic NOT
7
 Complement = Inverse = Negate = NOT (' ; ¯; ~; )
 0'=1, 1'=0
 Symbol
Basic switch
A A = 0  switch open
X X'
A = 1  switch closed
NOT gate
Inverter
 Truth table
X' X = 0  switch closed
Inputs Outputs
X = 1  switch open
X X’
0 1
1 0
Input combinations Output values

Boolean Algebra
Operation -- Logic AND
8
 AND (; )
 0  0 = 0, 0  1 = 0, 1  0 = 0, 1  1 = 1
 Symbol  Truth table Omit “”

A A B C = A B
 C=A  B 0 0 0
If one input is 0
B 0 1 0
 output is 0
AND gate 1 0 0
1 1 1

 Switch (in series)

A B T = 0  12 open
1 2
T = 1  12 closed
T=AB
Switch A closed and switch B closed

Boolean Algebra
Operation -- Logic OR
9
 OR (+; )
 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 1
 Symbol  Truth table
A A B C = A+B
+ C=A+B 0 0 0
If one input is 1
B 0 1 1
 output is 1
OR gate 1 0 1
1 1 1

 Switch (in parallel)


A

T = 0  12 open
1 2
B T = 1  12 closed

T=A+B Switch A closed or switch B closed

Boolean Algebra
10 Boolean Expressions and Truth Tables

Boolean
expression

Logic
gates
Truth table

Boolean Algebra
Boolean Expressions vs. Logic Gates
11
 A Boolean expression is formed by basic operations on variables or constants, e.g.,
the simplest one: 0, 1, X, Y'
 Realize a Boolean expression by a circuit of logic gates
 Perform operations in order: Parentheses  NOT  AND  OR

 e.g., AB' + C  1. B'  2. AB'  3. AB' + C


A
AB'

B + (AB' + C)
B' C
Boolean Expressions vs. Logic Gates
12

 e.g., [A(C + D)]' + BE Þ 1. C + D  2. A(C + D)  3. [A(C + D)]'


C  4. BE  5. [A(C + D)]' + BE
(C + D)
+ A(C + D) [A(C + D)]'
D 
A + [A(C + D)]' + BE

B
BE

Boolean Algebra E
n variables
Boolean Expressions vs. Truth Tables  2n rows
13
 A truth table specifies the output values of a Boolean expression for all possible
combinations of input values
  Check the equivalence between two expressions
 e.g., AB'+ C = (A + C)(B'+ C)
1 One function
A 0
has different
AB'
1 0  1 expressions
B + (AB' + C)
B' 1
C
Expressions show A B C B’ AB’ AB’ + C (A+C)
A+C B’+C
the condition to (B’+C)
0 0 0 1 0 0
make output ==1 0 0 1 1 0 1 0 1 0
0 1 0 0 0 0 1 1 1
0 1 1 0 0 1 0 0 0
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 1 1
1
1 1
1 1
1 0
0 0
0 1
1 1 0 0
Boolean Algebra 1 1 1
Example: F = A' + B
14

Boolean
expression
F = A' + B

?
-1
to
1-
Logic
gates
A' Truth table
A F = A' + B A B A’ A’+B
+
B 0 0 1 1
0 1 1 1
1 0 0 0
1 1 0 1

Boolean Algebra
Boolean algebra differs
from ordinary algebra in
values, operations, laws

15 Theorems and Laws

Boolean Algebra
Basic Theorems (1/3)
16
 Operations with 0 and 1
 X+0= X
The variable X
 X1= X
can be substituted
 X+1=1 by any expression
 X0= 0

 e.g., (AB' + D)E + 1 = 1

X
X
=
X+0=X
X

=
X+1=1
Boolean Algebra
Basic Theorems (2/3)
17
 Idempotent laws
 X+X=X
 XX= X

X
X
X
=
X+X=X

X X X
=
XX=X

Boolean Algebra
Basic Theorems (3/3)
18
 Involution law
 (X')' = X

 Laws of complementarity
 X + X' = 1
 X  X' = 0

 e.g., (AB' + D)(AB' + D)' = 0

X'
=
X + X' = 1

X X'
=
X  X' = 0
Boolean Algebra
Commutative/Associative Laws
19
 Commutative laws for AND and OR
 XY = YX
 X+Y=Y+X

 Associative laws for AND and OR


 (XY)Z = X(YZ) = XYZ

 (X + Y) + Z = X + (Y + Z) = X + Y + Z
 e.g., 2-input gates  multiple-input gates
A
 A
B  = B 
C C
A (AB)C = ABC
+ A
B + = B +
C C
Boolean Algebra (A + B) + C = A + B + C
Distributive Laws (1/2)
20
 Ordinary distributive law
 X(Y + Z) = XY + XZ
Only valid for
Boolean algebra
 Second distributive law (Important !)
 X + YZ = (X + Y)(X + Z)

 Proof?

Boolean Algebra
Distributive Laws (2/2)
21
 Prove a Boolean theorem/law by:
1. Truth table 2. Basic theorems
X + YZ = (X + Y)(X + Z)
=?
(X + Y)(X + Z)
(X+Y)
X Y Z YZ X+YZ X+Y X+Z
(X+Z) = X(X + Z) + Y(X + Z)
0 0 0 0 0 0 0 0 = XX + XZ + YX + YZ
0 0 1 0 0 0 1 0
= X + XZ + XY + YZ
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1 = X1 + XZ + XY + YZ
1 0 0 0 1 1 1 1 = X(1+Z+Y) + YZ
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1 = X1 + YZ
1 1 1 1 1 1 1 1 = X + YZ

Boolean Algebra
Simplification Theorems
22
 Useful simplification theorems
 XY + XY' = X  (X+Y)(X+Y') = X
 X + XY = X duality  X(X+Y) = X
 (X+Y') Y = XY  XY' + Y = X + Y

 Proof:
 X + XY = X1 + XY = X(1+Y) = X1 = X
 X(X+Y) = XX + XY = X + XY = X

 XY' + Y = Y + XY' = (Y+X)(Y+Y') = (Y+X)  1 = Y + X

 Use switches
Y Y

= X
X 22 Y'

If switch Y open  switch Y' closed


Boolean Algebra
Simplification Examples
23

1. A(A'+B) = AB

A
+ A
B  F =  F
A B
2. Z = [A + B'C + D + EF][A + B'C+ (D + EF)' ]
= [A + B'C + D + EF][A + B'C + (D + EF)' ]
=[ X + Y ][ X + Y' ]
= X = A + B'C
All roads lead
3. Z = (AB + C)(B'D + C'E')+(AB + C)' to Rome
= (AB + C)(B'D + C'E')+(AB + C)'
= X Y + X' = XY + X'1 = XY + X'(1+Y)
= XY + X' + X'Y = (X+X')Y + X'
= Y + X' = B'D + C'E'+(AB + C)'
Boolean Algebra
Multiplying Out
SOP: Sum of
24 products of only
 Use the ordinary distributive law single variables
X(Y + Z) = XY + XZ
to multiply out an expression to obtain a sum-of-products form
 e.g.,

AB' + CD'E + AC'E' (V)


A + B' + C + D'E (V)
(A + B)CD + EF (X)

Boolean Algebra
Example: Multiplying Out (A+BC)(A+D+E)
25

1. Multiply out completely and then eliminate redundant terms


(A+BC)(A+D+E) = A+AD+AE+ABC+BCD+BCE
= A(1+D+E+BC)+BCD+BCE
= A+BCD+BCE
2. Or, apply 2nd distributive law first: (X+Y)(X+Z)=X+YZ
(A+BC)(A+D+E) = A+BC(D+E)
= A+BCD+BCE

2nd distributed law


saves your time!

Boolean Algebra
Factoring
POS: Products
26 of sums of only
 Use the second distributive law single variables
X + YZ = (X + Y)(X + Z)
to factor an expression to obtain a product-of-sums form
 e.g.,

(A + B')(C + D + E)(A + C' + E') (V)


(A + B)(C + D + E)F (V)
AB'C(D' + E) (V)
(A + B)(C + D) + EF (X)

Boolean Algebra
Example: Factoring
27

1. Factor A + B'CD
A + B'CD = (A + B')(A + CD) = (A + B')(A + C)(A + D)

2. Factor AB'+ C'D


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

Iteratively apply
2nd distributed law
3. DIY: Factor C'D + C'E' + G'H

Ans: (G’+C’)(G’+D+E’)(H+C’)(H+D+E’)
Boolean Algebra
SOP vs. Logic Gates
28
 Realize SOPs by two-level circuits (AND-OR)
 AB' + CD'E + AC'E'  A + B' + C + D'E
AND OR AND OR

A D'
 
B' E A
B' +
C
C
D'  +
E

A
C' 
E'

Boolean Algebra
POS vs. Logic Gates
29
 Realize POSs by two-level circuits (OR-AND)
 (A + B')(C + D’ + E)(A + C' + E')  AB'C(D' + E)
OR AND OR AND

A A
+ B'
B' D' C 
+
C E
D' + 
E

A
C' +
E'

Boolean Algebra
DeMorgan’s Laws
30
 Complement a Boolean expression by DeMorgan’s laws
 (X + Y)' = X'Y'  (XY)' = X' + Y'
 Proof: By 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
 Generalize to n variables:
 (X +X +…+X )' = X 'X '... X '  (X1X2…Xn)' = X1'+X2'+...+ Xn'
1 2 n 1 2 n
 One-step rule:
 [f(x ,x ,…,x ,0,1,+,)]' = f(x ', x ',…,x ',1,0,,+)
1 2 n 1 2 n

 x  x'; +  ; 0  1

Boolean Algebra
Example: Complementing (AB' + C)D' + E
31

1. Iteratively apply DeMorgan’s laws:


[(AB' + C)D' + E]' = [(AB' + C)D' ]'E'
= [(AB' + C)'+D]E'
= [(AB')'C'+D]E' NOT is applied only
to single variables
= [(A'+B)C'+D]E'
2. Or, use one-step rule:
[(AB' + C)D' + E]' = [(((A  B')+C)  D')+ E]'
= (((A'+B) C') +D )  E'

Boolean Algebra
Duality
32
 Dual:
 [f(x ,x ,…,x ,0,1,+,)]D= f(x ,x ,…,x ,1,0,,+)
1 2 n 1 2 n

+  ; 0  1
 Cf. DeMorgan’s laws:
 [f(x ,x ,…,x ,0,1,+,)]' = f(x ',x ',…,x ',1,0,,+)
1 2 n 1 2 n

 x  x'; +  ; 0  1
  Find the dual of an expression:
 Complement the entire expression
 Complement each individual variable

 e.g., (XYZ…)D = X + Y + Z + …
 e.g., (AB' + C)D = ?
(AB' + C)' = (A'+B)C'  (AB' + C)D = (A+B')C
 Application: F = G  FD = GD

Boolean Algebra
Q&A

33 (To be continued)

Thank you very much


for your attention !
Homework of Unit 2
34
 Problem set: 2.8, 2.13, 2.15, 2.23, 2.27, 2.30
 Deadline: 1 week

Boolean Algebra

You might also like