Upload
natrix029
View
31
Download
1
Embed Size (px)
Citation preview
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
1/22
Princess Sumaya Univ.Computer Engineering Dept.
Chapter 2:
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
2/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
1 / 28
Basic Definitions
Binary Operators
AND
z= x y= x y z=1 if x=1 AND y=1
OR
z= x+ y z=1 if x=1 OR y=1
NOT
z= x=x z=1 if x=0
Boolean Algebra
Binary Variables: only 0 and 1 values
Algebraic Manipulation
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
3/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
2 / 28
Boolean Algebra Postulates
Commutative Law
x y= y x x+ y= y+ x
Identity Element
x 1 = x x+ 0 = x
Complement
xx= 0 x+x= 1
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
4/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
3 / 28
Boolean Algebra Theorems
Duality
The dualof a Boolean algebraic expression is obtained
by interchanging the ANDand the ORoperators and
replacing the 1s by 0s and the 0s by 1s.
x ( y+ z) = ( x y) + ( x z)
x+ ( y z) = ( x+ y) ( x+ z)
Theorem 1
x x= x x+ x= x
Theorem 2
x 0 = 0 x+ 1 = 1
App l ied to a validequat ion prod uces
a validequat ion
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
5/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
4 / 28
Boolean Algebra Theorems
Theorem 3: Involution
(x)= x ( x) = x
Theorem 4: Associative & Distr ibutive
( x y) z= x ( y z) ( x+ y) + z= x+ ( y+ z)
x ( y+ z) = ( x y) + ( x z)
x+ ( y z) = ( x+ y) ( x+ z)
Theorem 5: DeMorgan
( x y)=x +y ( x+ y)=x y ( x y)= x + y ( x+ y)= x y
Theorem 6: Absorption
x ( x+ y) = x x+ ( x y) = x
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
6/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
5 / 28
Operator Precedence
Parentheses
(. . . ) (. . .)
NOT
x+ y
AND
x+ xy
OR
])([ xwzyx
])([
)(
)()(
)(
xwzyx
xwzy
xwz
xw
xw
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
7/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
6 / 28
DeMorgans Theorem
)]([ edcba
)]([ edcba
))(( edcba
))(( edcba
))(( edcba
)( edcba
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
8/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
7 / 28
Boolean Functions
Boolean Expression
Example: F= x+yz
Truth Table
All possible combinationsof input variables
Logic Circuit
x y z F0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
x
yz
F
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
9/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
8 / 28
Algebraic Manipulation
Literal:
A single variable within a term that may be complemented
or not.
Use Boolean Algebra to simplify Boolean functions
to produce simpler circuits
Example: Simplify to a minimum number of literals
F= x+x y ( 3Literals)
= x+ (x y )
= ( x+x) ( x+ y)
= ( 1 ) ( x+ y) = x+ y ( 2Literals)
Distr ibut iv e law(+ over )
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
10/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
9 / 28
Complement of a Function
DeMorgans Theorm
Duality & Literal Complement
CBAF
CBAF
CBAF
CBAF
CBAF
CBAF
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
11/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
10 / 28
Canonical Forms
Minterm
Product (ANDfunction)
Contains all variables
Evaluates to 1 for a
specific combination
Example
A= 0 A B C
B= 0 (0) (0) (0)
C= 01 1 1= 1
A B C Minterm
0 0 0 0 m0
1 0 0 1 m1
2 0 1 0 m2
3 0 1 1 m3
4 1 0 0 m4
5 1 0 1 m5
6 1 1 0 m6
7 1 1 1 m7
CBA
CBA
CBA
CBA
CBA
CBA
CBA
CBA
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
12/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
11 / 28
Canonical Forms
Maxterm
Sum (ORfunction)
Contains all variables
Evaluates to 0 for a
specific combination
Example
A= 1 A B C
B= 1 (1) + (1) + (1)
C= 10 + 0 + 0= 0
A B C Maxterm
0 0 0 0 M0
1 0 0 1 M1
2 0 1 0 M2
3 0 1 1 M3
4 1 0 0 M4
5 1 0 1 M5
6 1 1 0 M6
7 1 1 1 M7
CBA
CBA
CBA
CBA
CBA
CBA
CBA
CBA
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
13/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
12 / 28
Canonical Forms
Truth Table toBoolean Function
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 11 1 0 0
1 1 1 1
CBAF CBA CBA ABC
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
14/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
13 / 28
Standard Forms
Sum of Products (SOP)
ABCCBACBACBAF
AC
BBAC
)(
CB
AACB
)(
BA
BA
CCBA
)1(
)(
)()()( BBACCCBAAACBF
ACBACBF
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
15/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
14 / 28
Standard Forms
Product of Sums (POS)
)( AACB
)( BBCA
)( CCBA
)()()( AACBCCBABBCAF
CBBACAF
CABBCACBACBAF
))()(( CBBACAF
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
16/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
15 / 28
Two-Level Implementations
Sum of Products (SOP)
Product of Sums (POS)
ACBACBF
))()(( CBBACAF
B
C
FBA
AC
AC
FBA
B
C
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
17/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
16 / 28
Logic Operators
AND
NAND (NotAND) x y NAND0 0 1
0 1 11 0 1
1 1 0
x y AND
0 0 0
0 1 0
1 0 0
1 1 1
x
yx
y
xy
x y
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
18/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
17 / 28
Logic Operators
OR
NOR (NotOR)
x y OR
0 0 0
0 1 1
1 0 1
1 1 1
x y NOR
0 0 1
0 1 01 0 0
1 1 0
xy
x+ y
x
y x+ y
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
19/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
18 / 28
Logic Operators
XOR (Exclusive-OR)
XNOR (Exclusive-NOR)
(Equivalence)
x y XOR
0 0 0
0 1 1
1 0 1
1 1 0
x y XNOR
0 0 1
0 1 0
1 0 0
1 1 1x
y
x y
x yxy + xy
x
yx y
xy + xy
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
20/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
19 / 28
Logic Operators
NOT (Inverter)
Buffer
x NOT
0 1
1 0
x Buffer
0 0
1 1
x x
x x
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
21/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
20 / 28
Multiple Input Gates
7/13/2019 Chapter 2 Boolean Algebra & Logic Gates
22/22
Princess Sumaya University 4241Digital Logic Design Computer Engineering Dept.
21 / 28
DeMorgans Theorem on Gates
AND Gate
F= x y F= (x y) F= x+ y
OR Gate
F= x+ y F= (x+ y) F= x y
Change the Shape and bubble all lines