IST 4 Information and Logic
T = today x= hw#x out x= hw#x due mon tue wed thr fri 31 M1 1 7 oh M1 14 oh 1 oh 2M2 21 oh oh 2 oh Mx= MQx out 28 oh M2 oh oh = office hours 5 3 12 oh 3 4 oh oh T midterms oh Mx= MQx due 19 oh oh 4 5 26 2 oh 5 oh oh oh
From ideas to physical implementation Today s most important slide Physical implementation with relay circuits Algorizms to small syntax boxes 0 1 0 0 1 1 1 0 Binary meets Boolean m-box Syntax boxes to Boolean algebra Boolean algebra to Physics
Boolean algebra functions s
Simple Boolean formula All the coefficients are 1 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 {B} n {B} defined by a simple Boolean formula
Boolean Functions Start with a simple Boolean formula Assign all possible elements to the formula Two element Boolean Algebra B= {0,1} ab OR(a,b) 00 0 01 10 11 1 1 1
Boolean Functions 2 Elements Start with a simple Boolean formula Assign all possible elements to the formula Two element Boolean Algebra B= {0,1} ab 00 0 01 1 10 1 11 0 XOR(a,b)
Boolean Functions 4 Elements????
Boolean Functions 4 Elements
Boolean Functions 4 Elements????
Boolean Functions 4 Elements
Boolean Functions 4 Elements
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 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
DNF E-Theorem DNF E-Theorem: Every Boolean function can be expressed in a DNF. 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 (A2) multiplying by Use self absorption (L1) to eliminate duplicate terms
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 + 1 + 111 =?? = 7+ 3 + 82+ 15 + 12 100 + 10 + 9 100 + 10 + 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 0-1 assignments it will be violated on 0-1 assignments
Idea: Being Normal is Boring... For which 0-1 assignments a normal term = 1? 011 101 110 101 100 A normal term is 1 for a single 0-1 assignment otherwise it is 0
Other direction: two different DNFs implies two different functions Proof: Idea: consider the value of the functions for the 0-1 assignments f = f = 1? f = 0? The boring gproperty: p A normal term is 1 for a single 0-1 assignment and 0 otherwise For any 0-1 assignment, either all terms are 0 or exactly one term is 1
Other direction: two different DNFs implies two different functions Proof: Idea: consider the value of the functions for the 0-1 assignments If two DNFs are different, there is a term that appears in one and does not appear in the other The 0-1 assignment that corresponds to this term results in a 1 for one DNF and in a 0 for the other. Q
Counting Functions DNF is a representation: Two Boolean functions are equal if and only if their DNFs are identical. Q1: How many different Boolean functions of n variables? Answer: This is 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
DNF is a representation: Two Boolean functions are equal if and only if their DNFs are identical. How is the all-0 function represented? Answer: How is the all-1 function represented? Answer: everything...
More 0-1 Ideas Q2: Are Boolean functions determined by their 0-1 entries? Yes By the proof of the DNF Representation Theorem: Two DNFs are identical if and only if they are equal for all 0-1 assignments
Current State Representation Theorem (Stone 1936): Every finite Boolean algebra is isomorphic to a Boolean algebra of subsets of some finite set S. 0-1 Theorem: An identity is true for any finite Boolean algebra if and only if it is true for a two-valued (0-1) Boolean algebra. DNF Representation Theorem: DNF is a representation: ti Two Boolean functions are equal if and only if their DNFs are identical.
Boolean algebra DNF and magic boxes s
From ideas to physical implementation Today s most important slide Physical implementation with relay circuits Algorizms to small syntax boxes 0 1 0 0 1 1 1 0 Binary meets Boolean m-box Syntax boxes to Boolean algebra Boolean algebra to Physics
Boolean Functions 2 Elements Start with a simple Boolean formula Assign all possible elements to the formula Two element Boolean Algebra B= {0,1} ab 00 0 01 1 10 1 11 0 XOR(a,b)
Boolean Functions 4 Elements ab 00 0 01 1 10 1 11 0 XOR(a,b)
Represent a syntax box with formula? DNF is a way to express a syntax box using a formula Any syntax box? Only binary! When B={0,1}, namely BINARY every mapping is a Boolean function
DNF is a way to express a syntax box using a formula value 1 in the syntax table = a normal term in the DNF Idea: construct a DNF by adding the normal terms that correspond to f=1 ab 00 0 01 10 11 XOR(a,b) 1 1 0 a = 1 then a = 0 then
DNF is a way to express a syntax box using a formula value 1 in the syntax table = a normal term in the DNF Idea: construct a DNF by adding the normal terms that correspond to f=1 ab f(a,b) 00 1 01 10 11 1 1 0
Q:Can we reason about magic boxes using Boolean algebra? YES A Boolean algebra is a formal system for reasoning about S-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 0 0 1 0 1 1 1 0 1 1 1 0
A magic box with Boolean algebra? Prove that it is magical? a b m 0 0 1 0 1 1 1 0 1 1 1 0
Analyzing the Magic Box using Boolean Algebra a b m 0 0 1 0 1 1 1 0 1 1 1 0 Can realize the operations of the algebra hence, can compute any DNF magical for Binary
The Magic Box Can Compute any Boolean Function???
The Magic Box Can Compute any Boolean Function 0 0
Algorithms Syntax Manipulation digit 1 digit 2 carry 2 symbol adder carry sum
Algorithms Syntax Manipulation digit 1 digit 2 1 0 carry 0 2 symbol adder 0 carry 1 sum
Algorithms Syntax Manipulation digit 1 digit 2 1 1 carry 1 2 symbol adder 0 carry 0 sum
Algorithms Syntax Manipulation 0 1 d1 d2 sum 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1 c 2 symbol adder c s 0 1 carry 0 1 0 1 0 0 0 0 0 1 1 0 1 1 1 1
Algorithms Syntax Manipulation 0 1 1 1 sum 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1 1 2 symbol adder 0 0 0 1 carry 0 1 0 1 0 0 0 0 0 1 1 0 1 1 1 1
1 1 1 0 0 0 1 1 c 2 symbol adder c c 2 symbol adder c c 2 symbol adder c c 2 symbol adder 0 s s s s 1101 + 1001 =?? 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1
1 1 1 0 0 0 1 1 1 2 symbol adder 0 0 2 symbol adder 0 0 2 symbol adder 1 1 2 symbol adder 0 0 1 1 0 1101 + 1001 = 10110 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 13 + 9 = 22 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1
c Algorithms Syntax Manipulation d1d d2d 2 symbol adder c s Can we write the DNF related to the sum and carry? d1 d2 c sum sum 0 1 0 0 0 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1
c Algorithms Syntax Manipulation d1d d2d 2 symbol adder c s Can we write the DNF related to the sum and carry? 0 1 d1 d2 c sum 0 0 0 0 0 0 1 1 sum 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1
d1d Algorithms Syntax Manipulation d2d c 2 symbol adder c s sum d1 d2 c sum 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1
XOR of More Variables??? abc 000 0 001 010 011 1 1 0 100 1 101 0 110 0 111 1 XOR(a,b,c) 0 sum sum
d1 Algorithms Syntax Manipulation d2 c 2 symbol adder c s Can we write the DNF related to the sum and sum 0 1 carry? 0 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 carry 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1
d1d Algorithms Syntax Manipulation d2d c 2 symbol adder c s carry d1 d2 c carry 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 carry 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 0 1 1 1 1
d1d Algorithms Syntax Manipulation d2d c 2 symbol adder c s carry 0 carry Can you simplify the carry?? 0 1 Distributive Absorption 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1
d1d Algorithms Syntax Manipulation d2d c 2 symbol adder c s carry 0 carry carry When is the carry 1? 0 1 Two or more inputs are 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1
The Carry Function abc MAJ(a,b,c) 000 0 001 0 010 0 011 1 100 0 101 1 110 1 111 1 carry
The Functions of the Adder d1 d2 c 2 symbol adder c s sum carry
The Functions of the Adder When was the first binary adder built? c d1 d2 2 symbol adder c s sum carry
The First Digital Adder George Stibitz, 1904-1995 1995 He worked at Bell Labs in New York relays, y tin In the fall of 1937 Stibitz used surplus can strips, flashlight bulbs, and other common items to construct his "Model K" K stands for kitchen...
George Boole 1815-1864 Trivia George Crum 1828-1914 What was invented first? Potato chips 1853 Manual Vacuum cleaner 1860 Source: wikipedia
Shannon 1916-2001
Shannon 1916-2001 Connection Between Boolean Calculus and Physical Circuits Shannon 1938 ~90 AB (After Boole) Relay on the edge controlled by a 0-1 variable 0 1
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 What is it computing? a b a b 2 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b c d e What is it computing? 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b c d e What is it computing? 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b c d e What is it computing? 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b c d e What is it computing? 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b c d e What is it computing? 5 relays
Connection Between Boolean Calculus and Physical Circuits Shannon 1938 a b d e
We need a language for S-boxes!! Feasibility Questions about building blocks? Given a set of building blocks: What can/cannot be constructed? Efficiency and complexity If feasible, how many blocks are needed? d? Algorizm? Next week: Implementing Boolean functions with relay circuits it