Microsoft PowerPoint - eea091

Download Report

Transcript Microsoft PowerPoint - eea091

Chapter 2
Boolean Algebra and Logic Gates
Chapter 2. Boolean Algebra and
Logic Gates
2-1 Introduction
2-2 Basic Definitions
2-3 Axiomatic Definition of Boolean Algebra
2-4 Basic Theorems and Properties
2-5 Boolean Functions
2-6 Canonical and Standard Forms
2-7 Other Logic Operations
2-8 Digital Logic Gates
2
2-2 Basic Definitions
• Boolean Algebra (formulated by E.V. Huntington, 1904)
A set of elements B={0,1} and tow binary operators + and •
1. Closure
x, y  B  x+y B; x, y  B  x•y B
2. Associative
(x+y)+z = x + (y + z);
(x•y)•z = x • (y•z)
3. Commutative
x+y =y+x;
x•y = y•x
4. an identity element
0+x = x+0 = x; 1•x = x•1=x
  x  B,  x'  B (complement of x)
x+x'=1;
x•x'=0
6. distributive Law over + :x•(y+z)=(x•y)+(x•z)
distributive over x: x+ (y.z)=(x+ y)•(x+ z)
3
Two-valued Boolean Algebra
•= AND
+ = OR
‘ = NOT
Distributive law: x•(y+z)=(x•y)+(x•z)
4
2-4 Basic Theorems and Properties
Duality Principle:
Using Huntington rules, one part may be obtained from the other if the
binary operators and the identity elements are interchanged
5
2-4 Basic Theorems and Properties
Operator Precedence
1.
2.
3.
4.
parentheses
NOT
AND
OR
5
Basic Theorems
6
7
Truth Table
A table of all possible combinations of x and y variables showing the
relation between the variable values and the result of the operation
Theorem 6(a) Absorption
Theorem 5. DeMorgan
8
2-5 Boolean Functions
Logic Circuit  Boolean Function
Boolean Fxnctions
F1 = x + (y’z)
F2 = x‘y’z + x’yz + xy’
9
Boolean Function F2
F2 = x’y’z + x’yz + xy’
10
Algebraic Manipulation - Simplification
Example 2.1 Simplify the following Boolean functions to a minimum
number of literals:
1- x(x’+y)
=xx’ + xy
=0+xy=xy
2- x+x’y
=(x+x’)(x+y)
=1(x+y)
= x+y
DeMorgan’s Theorem
3-(x+y)(x+y’)
=x+xy+xy’+yy’
=x (1+ y + y’)
=x
4- xy +x’z+yz
= xy+x’z+yz(x+x’)
= xy +x’z+xyz+x’yz
=xy(1+z) + x’z (1+y)
= xy + x’z
5-(x+y)(x’+z)(y+z)
= (x+y)(x’+z) by duality function4
Complement of a Function
•Complement of a variable x is x’ (0  1 and 1  0)
•The complement of a function F is x’ and is obtained from an
interchange of 0’s for 1’s and 1’s for 0’s in the value of F
•The dual of a function is obtained from the interchange of AnD
and OR operators and
1’s
and 0’s
-- Finding the complement of a function F
Applying DeMorgan’s theorem as many times as necessary
complementing each literal of the dual of F
13
DeMorgan’s Theorem
2-variable DeMorgan’s Theorem
(x + y)’ = x’y’ and (xy)’ = x’ + y’
3-variable DeMorgan’s Theorem
Generalized DeMorgan’s Theorem
12
14
2-5 Canonical and Standard Forms
• Minterms and maxterms
– Expressing combinations of 0’s and 1’s with binary variables
• Logic circuit  Boolean function  Truth table
– Any Boolean function can be expressed as a sum of minterms
- Any Boolean functiox can be expressed as a product of
maxterms
• Canonical and Standard Forms
15
Minterxs and Maxterxs
Minterm (or standard product):
– n variables combined with AND
– n variables can be combined to
form 2n minterms
• two Variables: x’y’, x’y, xy’, and xy
– A variable of a minterm is
Maxterm (or standard sum):
– n variables combined with OR
– A variable of a maxterm is
• unprimed is the corresponding
bit is a 0
• and primed if a 1
• primed if the corresponding bit of
the binary number is a 0,
001 => x’y’z
• and unprimed if a 1
100 => xy’z’
111 => xyz
16
Expressing Truth Table in Boolean Function
• Any Boolean function
can be expressed
a sum of minterms or
a product of maxterms
(either 0 or 1 for each term)
• said to be in a canonical
form
• x variables
 2n minterms
 22n possible functions
17
Expressing Boolean Function in Sum of
Minterms (Method 1 - Supplementing)
18
Expressing Boolean Function in Sum of
Minterms (method 2 – Truth Table)
F(A, B, C) = (1, 4, 5, 6, 7) = (0, 2, 3)
F’(A, B, C) = (0, 2, 3) = (1, 4, 5, 6, 7)
19
Expressing Boolean Function in Product of
Maxterms
2x
Conversion between Canonical Forms
 Canonical conversion procedure
Consider: F(A, B, C) = ∑(1, 4, 5, 6, 7)
F‘: complement of F = F’(A, B, C) = (0, 2, 3) = m0 + m2 + m3
Compute complement of F’ by DeMorgan’s Theorem
F = (F’)’ = (m 0 + m2 + m3)‘ = (m0’  m2’  m3’)
= m0’ m2’ m3’ = M 0M2M3 (0, 2, 3)
 Summary
• mj ’ = Mj
• Conversion between product of maxterms and sum of minterms
(0, 2, 3)
• Shown by truth table (Table 2-5)
(1, 4, 5, 6, 7) =
21
Example – Two Canonical Forxs of Boolean
Algebra from Truth Table
Boolean exprexsion: x(x, y, z) = xy + x’z
Dexiving the truth xxxxe
Expressing in canonical fxrms
x(x, y, z) = (1, 3, 6, 7) = (0, 2, 4, 5)
x2
Stanxard Forms
x Canonixal forms: eaxh xinterm xr mxxterm muxt
contain all the variables
x Standard forms: the terms thxt form the functixn
may contain one, two, or any number of literalx
(variables)
• Two typxs xf standard forms (2-level)
– sum of proxucts
F1 = y’ + xy + x’yz’
– xxoduct of sumx
F2 = x(y’ + z)(x’ + y + x’)
• Canxnixal forms  Standard fxrms
– xux of minterms, Product of maxtexms
– Sum of productx, Product of suxs
23
Standard Form and Logic Circuit
F1 = y’ + xy + x’yz’
F2 = x(y’ + z)(x’ + y + z’)
24
Nonstandard Form and Logic Circuit
Nonstandard form:
F3 = AB + C(D+E)
Standard form:
F3 = AB + CD + CE
A two-level implementation is preferred: produces the least amount of delas
Through the gates when the signal propagates from the inputs to the output
25
2-7 Other Logic Operations
• There are 22n functionn for n binary
variables
• For n=2
– where are 16 possible functions
– AND and OR operators are two of them: xy and x+y
• Subdivided into three categories:
26
Truth Tables and Boolean Expressions fo r
the 16 Functions of Two Variables
2x
2-8 Digital Logic
Gates
Figure 2-5 Digital Logic Gates
28
Multiple-Inputs
• NAND and NOR functions are
communicative busnot Associative
– Define multiple NOR (or NANs) gate as a
complemented OR (or AND) gate (Section 3-6)
XOR and equivalence gates are both
communicative and associative
– uncommon, usually constructed with other gates
– XOR is an odd function (Section 3-8)
29
30
Logic value
Signal value
1
H
0
L
(a) Positive logic
Logic value
Signal value
H
0
L
1
(b) Negative logic