IST 4 Information and Logic
T = today x= hw#x out x= hw#x due mon tue wed thr 28 M oh 4 oh M oh oh 2 M2 8 oh oh 2 fri oh oh = office hours oh 25 oh M2 2 3 oh T midterms oh Mx= MQx out 9 oh 3 4 oh Mx= MQx due 6 oh oh 4 5 23 3 oh 5 oh oh oh
from physics envelops abacus writing numbers to symbols
from physics envelops abacus writing numbers starting today: to symbols symbols to physics-computation
From ideas to physical implementation Today s most important slide Physical implementation of syntax boxes with relay circuits Claude Shannon Algorizms to small syntax boxes m-box Syntax boxes to Boolean algebra Boolean algebra to Physics
Boolean algebra formulae and functions
Simple Boolean formula All the coefficients are Feasible for an arbitrary (finite) Boolean algebra
Boolean Functions Given a Boolean algebra with a set of elements B A Boolean function is a mapping from n {B} à {B} defined by a simple Boolean formula
Boolean Functions 2 Elements Start with a simple Boolean formula Assign all possible elements to the formula Two element Boolean Algebra B= {,} a b ab OR(a,b) + = + = + = + = Mapping of a simple Boolean formula to a syntax box
Boolean Functions 4 Elements + ab OR(a,b)
Boolean Functions 2 Elements Start with a simple Boolean formula Assign all possible elements to the formula Two element Boolean Algebra B= {,} ab XOR(a,b) a b Mapping of a simple Boolean formula to a syntax box
Boolean Functions 4 Elements ab XOR(a,b)
Boolean algebra DNF s
DNF Disjunctive Normal Form Idea: Representing a Boolean function with a formula of a specific form
Representation of Boolean Functions Disjunctive (Additive) Normal Form (DNF): Sum of terms, each term is Normal Normal = contains all the variables or their complements
Representation of Boolean Functions Disjunctive (Additive) Normal Form (DNF): Sum of terms, each term is Normal Normal = contains all the variables or their complements No! Is it a DNF? This term is not normal
DNF E-Theorem Every Boolean function can be Expressed in a DNF
Every Boolean function can be Expressed in a DNF Expressed the following in a DNF T4 A A2 A4 T3 A3 L
DNF E-Theorem: DNF E-Theorem Every Boolean function can be xpressed in a Proof: By the algorithm Apply DeMorgan Theorem (T4) until each negation is applied to a single variable Apply distributive axiom (A4) to get a sum of terms Augment a missing variable a to a term using (A,A2,A4) multiplying by Use (A3, T3) and self absorption (L) to eliminate duplicate terms
Being Normal is Boring... For which - assignments a normal term =? xy AND(x,y) A normal term is for a single - assignment otherwise it is iff both x and y are
Being Normal is Boring... For which - assignments a normal term =? Normal - assignment, corresponds to a normal term A normal term is for a single - assignment otherwise it is
A Boolean function is for the normal - assignments and for the other - assignments DNF Normal - assignments Boolean function syntax table ab XOR(a,b)
A Boolean function is for the normal assignments and for the other - assignments DNF - assignments Normal - assignments Other - assignments
DNF Representation Theorem DNF Representation Theorem: DNF is a representation: two Boolean functions are equal if and only if their DNFs are identical. 5 + 2 + + =?? = 7+ 3 + 82+ 5 + 2 + + 9 + + 9
DNF Representation Theorem DNF Representation Theorem: DNF is a representation: two Boolean functions are equal if and only if their DNFs are identical. Proof: Easy direction: DNFs identical implies functions are equal Other direction: DNF are different implies functions are not equal Idea: consider the value of the functions for the - assignment
Other direction: two different DNFs implies two different functions Proof: Idea: consider the value of the functions for the - assignments If two DNFs are different, there is a term that appears in one and does not appear in the other The - normal assignment that corresponds to this term results in a for one DNF and in a for the other. Q
DNF is a representation: Two Boolean functions are equal if and only if their DNFs are identical. Q: How is the all- function represented? Answer: Q: How is the all- function represented? Answer: everything...
Counting Functions DNF is a representation: Two Boolean functions are equal if and only if their DNFs are identical. Q: How many different Boolean functions of n variables? Answer: The same as the number of different DNFs of n variables Number of different normal terms of n variables? A normal term can appear/not appear in a DNF
Boolean algebra DNF from syntax boxes
Represent a syntax box with formula? DNF is a way to express a syntax box using a formula Any syntax box? We will focus on binary It works only for binary!
DNF is a way to express a syntax box using a formula normal assignment in the syntax table = a normal term in the DNF Idea: construct a DNF by adding the normal terms that correspond to the normal assignments ab XOR(a,b)
DNF is a way to express a syntax box using a formula normal assignment in the syntax table = a normal term in the DNF Idea: construct a DNF by adding the normal terms that correspond to the normal assignments ab f(a,b)
Boolean algebra DNF and magic boxes
Q:Can we reason about magic boxes using Boolean algebra? YES A Boolean algebra is a language for reasoning about syntax boxes A MAGIC BOX: binary s-box that can compute binary s-box?
A magic box with Boolean algebra? Prove that it is magical? a b m
A magic box with Boolean algebra? Prove that it is magical? a b m First idea: DNF of m(a,b)
A magic box with Boolean algebra? Prove that it is magical? Second idea? a b m Compute the operations of the Boolean algebra with m(a,b)
Analyzing the Magic Box using Boolean Algebra a b m Can realize the operations of the algebra hence, can compute any DNF magical for Binary
The Magic Box Can Compute any Boolean Function??? output in DNF?
The Magic Box Can Compute any Boolean Function HW#3
Binary Adder Gottfried Leibniz 646-76 digit digit 2 3 bits to 2 bits carry 2 symbol adder carry Represent the number of s in the input as two bits in base 2 sum
s c d d2 c parity majority d d2 c
majority parity d d2 c c d d2 c s majority parity
In HW#3: Compute parity and majority with magic boxes... d d2 majority c 2 symbol adder c s parity
Shannon 96-2
Shannon 96-2 Connection Between Boolean Calculus and Physical Circuits Shannon 938 Relay on the edge controlled by a - variable ~9 AB (After Boole)
Connection Between Boolean Calculus and Physical Circuits Shannon 938 What is it computing? When is it connected? a b ab AND(a,b) connected a ab OR(a,b) disconnected b 2 relays
Shannon 96-2 Next week: Implementing Boolean functions with relay circuits