ENEE244-02xx Digital Logic Design Lecture 4

advertisement
ENEE244-02xx
Digital Logic Design
Lecture 4
Announcements
• HW 1 due today.
• HW 2 up on course webpage, due on
Thursday, Sept. 18.
• “Small quiz” in recitation on Monday, Sept. 15
on material from Lectures 1,2
Agenda
• Last time:
– Error Detecting and Correcting Codes (2.11, 2.12)
– Boolean Algebra (3.1)
• This time:
– Boolean Algebra axioms and theorems (3.1, 3.2)
– Boolean Formulas and Functions (3.4)
– Canonical Formulas (3.5)
Boolean Algebra
Definition of a Boolean Algebra
• A mathematical system consisting of:
– A set of elements 𝐡 [0/1 or T/F]
– Two binary operators (+) and (⋅) [OR/AND]
– = for equivalence, () indicating order of operations
Where the following axioms/postulates hold:
– P1. Closure
For all π‘₯, 𝑦 ∈ 𝐡, π‘₯ + 𝑦 ∈ 𝐡, π‘₯ ⋅ 𝑦 ∈ 𝐡
– P2. Identity
There exist identity elements in 𝐡, denoted 0,1 relative
to (+) and (⋅), respectively.
For all π‘₯ ∈ 𝐡, 0 + π‘₯ = π‘₯ + 0 = π‘₯, 1 ⋅ π‘₯ = π‘₯ ⋅ 1 = π‘₯.
Definition of Boolean Algebra
– P3. Commutativity
The operations (+), (⋅) are commutative
For all π‘₯, 𝑦 ∈ 𝐡 π‘₯ + 𝑦 = 𝑦 + π‘₯, π‘₯ ⋅ 𝑦 = 𝑦 ⋅ π‘₯
– P4. Distributivity
***Each operation (+), (⋅) is distributive over the other.
For all π‘₯, 𝑦, 𝑧 ∈ 𝐡:
π‘₯ + 𝑦 ⋅ 𝑧 = π‘₯ + 𝑦 ⋅ π‘₯ + 𝑧 [π‘₯ 𝑂𝑅 (𝑦 𝐴𝑁𝐷 𝑧)]
π‘₯ ⋅ 𝑦 + 𝑧 = π‘₯ ⋅ 𝑦 + (π‘₯ ⋅ 𝑧) [π‘₯ 𝐴𝑁𝐷 (𝑦 𝑂𝑅 𝑧)]
Definition of Boolean Algebra
– P5. Complement
For every element π‘₯ ∈ 𝐡 there exists an element
π‘₯ ∈ 𝐡called the complement of π‘₯ such that:
π‘₯+π‘₯ =1
π‘₯⋅π‘₯ =0
– P6. Non-triviality
There exist at least two elements π‘₯, 𝑦 ∈ 𝐡 such that
π‘₯ ≠ 𝑦.
Principle of Duality
• (Except for P6), each postulate consists of two
expressions s.t. one expression is transformed
into the other by interchanging the operations (+)
and (⋅) as well as the identity elements 0 and 1.
• Such expressions are known as duals of each
other.
• If some equivalence is proved, then its dual is also
immediately true.
• E.g. If we prove: π‘₯ ⋅ π‘₯ + π‘₯ ⋅ π‘₯ = 1, then we
have by duality: π‘₯ + π‘₯ ⋅ π‘₯ + π‘₯ = 0
Theorems of Boolean Algebra
Theorem 3.2: Null elments:
For each element π‘₯ in a Boolean algebra:
π‘₯+1=1
π‘₯ ⋅ 0 = 0.
Proof:
π‘₯ + 1 = 1 ⋅ π‘₯ + 1 [by P2]
= π‘₯ + π‘₯ ⋅ π‘₯ + 1 [by P5]
=π‘₯+ π‘₯⋅1
[by P4]
=π‘₯+π‘₯
[by P2]
= 1.
by P5
Second part follows from principle of duality.
Theorems of Boolean Algebra
Theorem 3.4: The Idempotent law
For each element π‘₯ in a Boolean algebra:
π‘₯+π‘₯ =π‘₯
π‘₯⋅π‘₯ =π‘₯
Proof:
π‘₯ + π‘₯ = 1 ⋅ π‘₯ + π‘₯ [by P2]
= π‘₯ + π‘₯ ⋅ π‘₯ + π‘₯ [by P5]
=π‘₯+ π‘₯⋅π‘₯
[by P4]
=π‘₯+0
[by P5]
= π‘₯.
[by P2]
Second part follows from principle of duality.
Theorems of Boolean Algebra
Theorem 3.5: The Involution Law
For every π‘₯ in a Boolean algebra, π‘₯ = π‘₯.
Proof. We will use the fact that the complement is unique
(Theorem 3.1 in textbook).
π‘₯ + π‘₯ = 1 [by P5]
π‘₯ + π‘₯ = 1 [by P3]
π‘₯ = π‘₯ by uniqueness.
Moreover,
π‘₯ ⋅ π‘₯ = 0 [by P5]
π‘₯ ⋅ π‘₯ = 1 [by P3]
π‘₯ = π‘₯ by uniqueness.
Theorems of Boolean Algebra
Theorem 3.6: The absorption law
For each pair of elements π‘₯, 𝑦 in a Boolean algebra:
π‘₯+π‘₯⋅𝑦 =π‘₯
π‘₯⋅ π‘₯+𝑦 =π‘₯
Proof:
π‘₯ + π‘₯ ⋅ 𝑦 = π‘₯ ⋅ 1 + π‘₯ ⋅ 𝑦 [by P2]
= π‘₯ ⋅ 1 + 𝑦 [by P4]
= π‘₯ ⋅ 1 [by Theorem 3.2]
= π‘₯ [by P2]
Second part follows from principle of duality.
Theorems of Boolean Algebra
Theorem 3.7: DeMorgan’s Law
For each pair of elements π‘₯, 𝑦 in a Boolean algebra:
Note: Using
(π‘₯ + 𝑦) = π‘₯ ⋅ 𝑦
Associativity
(π‘₯ ⋅ 𝑦) = π‘₯ + 𝑦
of each
operation
Proof:
(+), (⋅).
π‘₯ + 𝑦 + π‘₯ ⋅ 𝑦 = π‘₯ + 𝑦 + π‘₯ ⋅ π‘₯ + 𝑦 + 𝑦 [by P4]
Theorem 3.8
= π‘₯ + π‘₯ + 𝑦 ⋅ 𝑦 + 𝑦 + π‘₯ [by P3]
= 1 + 𝑦 ⋅ 1 + π‘₯ [by P5]
= 1 ⋅ 1 [by Theorem 3.2]
= 1 [by P2]
Analogous for multiplicative case.
Second part follows from principle of duality.
A Two-Valued Boolean Algebra
• 𝐡 = 0,1
• (+) = OR, (⋅) = AND
•
1 = 0, 0 = 1
OR
Can verify that all the postulates
hold by “perfect induction.”
[Checking that equality holds for all
possible variable settings]
AND
x
y
x
0
1
0
0
1
1
1
1
y
0
1
0
0
0
1
0
1
Boolean Formulas and Functions
• Example: 𝑓 π‘₯, 𝑦, 𝑧 = π‘₯ + 𝑦 𝑧
• Can be specified via a truth table.
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
0
1
0
1
0
1
1
0
0
1
1
1
1
Normal Forms
• Consider the function:
𝑓 𝑀, π‘₯, 𝑦, 𝑧 = π‘₯ + 𝑀𝑦 + 𝑀𝑦𝑧
• A literal is an occurrence of a complemented
or uncomplemented variable in a formula.
• A product term is either a literal or a product
(conjunction) of literals.
• Disjunctive normal form: A Boolean formula
written as a single product term or as a sum
(disjunction) of product terms.
Normal Forms
• Consider the function:
𝑓 𝑀, π‘₯, 𝑦, 𝑧 = 𝑧(π‘₯ + 𝑦)(𝑀 + π‘₯ + 𝑦)
• A sum term is either a literal or a sum
(disjunction) of literals.
• Conjunctive normal form: A Boolean formula
written as a single sum term or as a product
(conjunction) of sum terms.
Canonical Formulas
• How to obtain a Boolean formula given a truth
table?
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
0
Minterm Canonical Formula
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
0
𝑓 π‘₯, 𝑦, 𝑧 = π‘₯ 𝑦 𝑧 + π‘₯𝑦 𝑧 + π‘₯ 𝑦 𝑧
π‘₯𝑦𝑧
π‘₯𝑦𝑧
π‘₯𝑦𝑧
m-Notation
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
0
π‘₯𝑦𝑧
π‘₯𝑦𝑧
π‘₯𝑦𝑧
• 𝑓 π‘₯, 𝑦, 𝑧 can be written as 𝑓 π‘₯, 𝑦, 𝑧 = π‘š1 +
π‘š 3 + π‘š4
• 𝑓 π‘₯, 𝑦, 𝑧 = Σπ‘š(1,3,4)
Maxterm Canonical Formula
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
0
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
𝑓 π‘₯, 𝑦, 𝑧 = π‘₯ + 𝑦 + 𝑧 π‘₯ + 𝑦 + 𝑧
(π‘₯ + 𝑦 + 𝑧)(π‘₯ + 𝑦 + 𝑧)(π‘₯ + 𝑦 + 𝑧)
M-Notation
X
Y
Z
f
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
0
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
π‘₯+𝑦+𝑧
• 𝑓 π‘₯, 𝑦, 𝑧 can be written as 𝑓 π‘₯, 𝑦, 𝑧 =
𝑀0 𝑀2 𝑀5 𝑀6 𝑀7
• 𝑓 π‘₯, 𝑦, 𝑧 = Π𝑀(0,2,5,6,7)
Download