Download presentation
Presentation is loading. Please wait.
1
Boolean Algebra cont’ The digital abstraction Graphs and Topological Sort מבנה המחשב + מבוא למחשבים ספרתיים תרגול 2#
2
Theorem 11: DeMorgan’s Law For every pair of elements a, b B, 1. ( a + b )’ = a’ · b’ 2. ( a · b )’ = a’ + b’ Proof: (1) We first prove that (a+b) is the complement of a’·b’. Thus, (a+b)’ = a’·b’ By the definition of the complement and its uniqueness, it suffices to show: (i) (a+b)+(a’b’) = 1 and (ii) (a+b)(a’b’) = 0. (2) Duality(a·b)’ = a’+b’
3
Distributivity Commutativity Associativity a’ and b’ are the complements of a and b respectively Theorem: For any a B, a + 1 = 1 Idempotent Law
4
Commutativity Distributivity Commutativity Associativity Commutativity a’ and b’ are the complements of a and b respectively Theorem: For any a B, a · 0 = 0 Idempotent Law
5
Transfer function for an inverter Given an electronic device whose transfer function is: f(x) = 1-x Is it a valid device for an inverter? In the two threshold model: Yes, chose for example V low = 0.25, V high = 0.75 In the (more realistic) four threshold model?
6
Transfer function for an inverter (cont.) Assume it is a valid device There exists four numbers v il, v ih, v ol, v oh such that: f(v il ) v oh,namely if in signal is v il the out signal is v oh. (the device is an inverter). f(v ih ) v ol (same as above) v ol < v il < v ih < v oh (4-thresholds model). However, according to the transfer function: f(v ih ) = 1- v ih f(v il ) = 1- v il
7
Transfer function for an inverter (con. 2) 1- v il v oh and 1- v ih v ol v oh + v il 1 and v ol + v ih 1 A contradiction, since v oh > v ol and v il > v ih Conclusion: not any monotonically decreasing function is adequate to be a transfer function in the 4-thresholds model.
8
Graph Representation by List of Neighbors 6 7 8 3 4 5 2 13586 756 28
9
Graph Representation by Matrix v v v 12345 1 2 3 4 5
10
Topological Sort Works only on Directed Acyclic Graphs (DAG). Notations: –In degree: The number of edges entering a vertex. –Sources: vertices with in-degree 0. The Algorithm: –Initialize: V The set of all vertices. –While V is not empty Extract a source s (if non-exists, then not a dag). Decrease the incoming degree of all its neighbors. Set s to be the next vertex in the topological order.
11
Topological Sort Example OR AND NOT XOROUT IN = Independent Vertex
12
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN
13
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN
14
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN OR
15
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN ORAND
16
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN ORANDNOT
17
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN ORANDNOTXOR
18
Topological Sort Example OR AND NOT XOROUT IN The Topological Sort: IN ORANDNOTXOROUT
19
The next slides are for the interested students (home reading)
20
Theorem: Associative Law In a Boolean algebra, each of the binary operations ( + ) and ( · ) is associative. That is, for every a, b, c B, 1. a + ( b + c ) = ( a + b ) + c 2. a · ( b · c ) = ( a · b ) · c
21
Distributivity Commutativity Distributivity Absorption Law Idempotent Law Proof: (1) Let
22
Commutativity Distributivity Idempotent Law Absorption Law Commutativity Absorption Law
23
Putting it all together: Same transitions · before +
24
(2) Duality Also,
25
Dual transformation - Recursive definition: Dual: expressions → expressions base: 0 → 1 1 → 0 a → a, a B\{0,1} recursion step: Let E 1 and E 2 be Boolean expressions. Then, E 1 ’ → [dual(E 1 )]’ ( E 1 + E 2 ) → [ dual(E 1 ) · dual(E 2 ) ] ( E 1 · E 2 ) → [ dual(E 1 ) + dual(E 2 ) ] Boolean expression - Recursive definition: base: 0, 1, a B – expressions. recursion step: Let E 1 and E 2 be Boolean expressions. Then, E 1 ’ ( E 1 + E 2 ) ( E 1 · E 2 )
26
Proof: Let f ( x 1, x 2, …, x n ) be a Boolean expression. We show that applying the complement on the whole expression together with replacing each variable by it’s complement, yields the dual transformation definition. Let f d be the dual of a function f ( x 1, x 2, …, x n ) Lemma: In switching algebra, f d = f’ ( x 1 ’, x 2 ’, …, x n ’ ) Induction basis: 0, 1 – expressions.
27
Induction hypothesis: Lemma holds for Boolean expressions: E 1 and E 2. That is: Induction step: show that it is true for E 1 ’ ( E 1 + E 2 ) ( E 1 · E 2 ) If then,
28
If then, If then,
29
Definition: A function f is called self-dual if f = f d Lemma: For any function f and any two-valued variable A, the function g = Af + A’f d is a self-dual. Proof: (holds for any Boolean algebra) Dual definition Distributivity Commutativity
30
Notice that the above expression has the form: ab + a’c +bc where “a” =A, “b”=f, “c” = f d. Distributivity Commutativity A’ is the complement of A Identity Commutativity
31
We now prove a stronger claim: Identity a’ is the complement of a Distributivity Commutativity Distributivity Theorem: For any a B, a + 1 = 1 Identity
32
For example: self-dual
33
Easier proof (1) for switching algebra only: (using dual properties) Switching algebraOR Identity
34
A = 0 0’ = 1 Identity Commutativity Absorption Law Theorem: For any a B, a · 0 = 0 Identity Easier proof (2) for switching algebra only: (case analysis)
35
A = 1
36
Algebra of Sets Consider a set S. B = all the subsets of S (denoted by P(S)). “plus” set-union ∪ “times” set-intersection ∩ Additive identity element – empty set Ø Multiplicative identity element – the set S. Complement of X B:
37
Theorem: The algebra of sets is a Boolean algebra. Proof: By satisfying the axioms of Boolean algebra: B is a set of at least two elements For every non empty set S: →|B| ≥ 2. Closure of ( ∪ ) and (∩) over B (functions ).
38
A1. Cummutativity of ( ∪ ) and ( ∩ ). An element lies in the union precisely when it lies in one of the two sets X and Y. Equally an element lies in the union precisely when it lies in one of the two sets X and Y. Hence,
39
A2. Distributivity of ( ∪ ) and ( ∩ ). Let and or If,We haveand. Hence, If,We haveand. Hence, or
40
Taking (*) and (**) we get, Distributivity of union over intersection can be conducted in the same manner.
41
This can be conducted in the same manner as ⊆. We present an alternative way: Definition of intersection and Also, definition of intersection definition of union Similarly, * **
42
A3. Existence of additive and multiplicative identity element. A4. Existence of the complement. Algebra of sets is Boolean algebra.All axioms are satisfied
43
Example 2 of a transfer function for an inverter
44
slope = -1
45
true only if:
46
BUT, this is not always the case. For example: slope = -1 Moreover, in this example it can be proved that no threshold values exist, which are consistent with definition 3 from lecture notes.
47
Using the assumption: slope < -1 f (x) = x
48
slope < -1
49
true if: f (x) = x slope < -1 slope = -1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.