Logic Design - Unit 2 20220803
Logic Design - Unit 2 20220803
BOOLEAN ALGEBRA
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
Boolean Algebra
Introduction
4
History
George Boole developed Boolean algebra in 1847 and
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
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
A B T = 0 12 open
1 2
T = 1 12 closed
T=AB
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
T = 0 12 open
1 2
B T = 1 12 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
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
Boolean Algebra
Basic Theorems (1/3)
16
Operations with 0 and 1
X+0= X
The variable X
X1= X
can be substituted
X+1=1 by any expression
X0= 0
X
X
=
X+0=X
X
=
X+1=1
Boolean Algebra
Basic Theorems (2/3)
17
Idempotent laws
X+X=X
XX= X
X
X
X
=
X+X=X
X X X
=
XX=X
Boolean Algebra
Basic Theorems (3/3)
18
Involution law
(X')' = X
Laws of complementarity
X + X' = 1
X X' = 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
(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 = X1 + 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 = X1 + 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 = X1 + XY = X(1+Y) = X1 = X
X(X+Y) = XX + XY = X + XY = X
Use switches
Y Y
= X
X 22 Y'
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.,
Boolean Algebra
Example: Multiplying Out (A+BC)(A+D+E)
25
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.,
Boolean Algebra
Example: Factoring
27
1. Factor A + B'CD
A + B'CD = (A + B')(A + CD) = (A + B')(A + C)(A + 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
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)
Boolean Algebra