1 / 49

Boolean Algebra cont’ The digital abstraction Graphs and Topological Sort

מבנה המחשב + מבוא למחשבים ספרתיים תרגול 2#. Boolean Algebra cont’ The digital abstraction Graphs and Topological Sort. Theorem 11: DeMorgan’s Law For every pair of elements a , b  B, ( a + b ) ’ = a’ · b’ ( a · b ) ’ = a’ + b’. Proof:

bridie
Download Presentation

Boolean Algebra cont’ The digital abstraction Graphs and Topological Sort

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. מבנה המחשב + מבוא למחשבים ספרתייםתרגול 2# Boolean Algebra cont’The digital abstractionGraphs and Topological Sort

  2. Theorem 11: DeMorgan’s Law • For every pair of elements a , b  B, • ( a + b )’ = a’ · b’ • ( 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 Vlow = 0.25, Vhigh = 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 vil, vih, vol, voh such that: • f(vil)  voh ,namely if in signal is  vil the out signal is  voh. (the device is an inverter). • f(vih)  vol (same as above) • vol < vil < vih < voh (4-thresholds model). • However, according to the transfer function: • f(vih) = 1- vih • f(vil) = 1- vil

  7. Transfer function for an inverter (con. 2) •  1- vil  voh and 1- vih  vol •  voh + vil  1 and vol + vih  1 •  A contradiction, since voh > vol and vil > vih • Conclusion: not any monotonically decreasing function is adequate to be a transfer function in the 4-thresholds model.

  8. Graph Representationby List of Neighbors 1 3 5 6 8 2 3 7 5 6 4 5 2 8 6 7 8

  9. Graph Representationby Matrix

  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 IN AND OR XOR OUT NOT IN = Independent Vertex

  12. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN

  13. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN

  14. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN OR

  15. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN OR AND

  16. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN OR AND NOT

  17. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN OR AND NOT XOR

  18. Topological Sort Example IN AND OR XOR OUT NOT IN The Topological Sort: IN IN OR AND NOT XOR OUT

  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, • a +( b + c )= ( a + b ) + c • a · ( b · c ) = ( a · b ) · c

  21. Proof: (1) Let Distributivity Commutativity Distributivity Distributivity Idempotent Law Absorption Law Absorption Law

  22. Commutativity Distributivity Distributivity Idempotent Law Absorption Law Commutativity Absorption Law

  23. Same transitions Putting it all together: · before +

  24. Also, (2) Duality

  25. Boolean expression - Recursive definition: base: 0 , 1 , a  B – expressions. recursion step: Let E1 and E2 be Boolean expressions. Then, E1’ ( E1 + E2 ) ( E1 · E2 ) Dual transformation - Recursive definition: Dual: expressions → expressions base: 0 → 1 1 → 0 a → a , a  B\{0,1} recursion step: Let E1 and E2 be Boolean expressions. Then, E1’ → [dual(E1)]’ ( E1 + E2 ) → [ dual(E1) · dual(E2) ] ( E1 · E2 ) → [ dual(E1) + dual(E2) ]

  26. Let fd be the dual of a function f ( x1 , x2 , … , xn ) Lemma: In switching algebra, fd = f’ ( x1’, x2’, … , xn’) Proof: Let f ( x1 , x2 , … , xn ) 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. Induction basis: 0 , 1 – expressions.

  27. If Induction hypothesis: Lemma holds for Boolean expressions: E1 and E2 . That is: Induction step: show that it is true for E1’ ( E1 + E2 ) ( E1 · E2 ) then,

  28. If then, If then,

  29. Definition: A function f is called self-dual if f = fd Lemma:For any function f and any two-valued variable A, the function g = Af + A’fd is a self-dual. Proof:(holds for any Boolean algebra) Dual definition Distributivity Commutativity

  30. Distributivity Commutativity A’ is the complement of A Identity Commutativity Notice that the above expression has the form: ab + a’c +bc where “a” =A, “b”=f, “c” = fd.

  31. We now prove a stronger claim: Identity a’ is the complement of a Distributivity Commutativity 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 algebra OR Identity

  34. Easier proof (2) for switching algebra only: (case analysis) A = 0 0’ = 1 Identity Commutativity Theorem: For any a  B, a · 0 = 0 Absorption Law Identity

  35. A = 1

  36. Complement of X  B: 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.

  37. B is a set of at least two elements • For every non empty set S: • → |B| ≥ 2. • Closure of (∪) and (∩) over B (functions ) . Theorem: The algebra of sets is a Boolean algebra. Proof: By satisfying the axioms of Boolean algebra:

  38. 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, A1. Cummutativity of ( ∪ ) and ( ∩ ).

  39. We have and . Hence, If , If , We have and . Hence, A2. Distributivity of ( ∪ ) and ( ∩ ). Let and or or

  40. Taking(*) and (**) we get, Distributivity of union over intersection can be conducted in the same manner.

  41. and This can be conducted in the same manner as ⊆. We present an alternative way: Definition of intersection * Also, definition of intersection definition of union Similarly, **

  42. A3. Existence of additive and multiplicative identity element. A4. Existence of the complement. All axioms are satisfied Algebra of sets is Boolean algebra.

  43. Example 2 of a transfer function for an inverter

  44. slope = -1 slope = -1

  45. slope = -1 slope = -1 true only if:

  46. slope = -1 slope = -1 BUT, this is not always the case. For example: Moreover, in this example it can be proved that no threshold values exist, which are consistent with definition 3 from lecture notes.

  47. f (x) = x Using the assumption: slope < -1

  48. f (x) = x slope < -1

  49. slope = -1 f (x) = x slope = -1 true if: slope < -1

More Related