• No results found

IST 4 Information and Logic

N/A
N/A
Protected

Academic year: 2021

Share "IST 4 Information and Logic"

Copied!
50
0
0

Loading.... (view fulltext now)

Full text

(1)

IST 4

Information and Logic

(2)

mon tue wed thr fri

28 M1 1

4 M1

11 1 2 M2

18 2

25 M2

2 3

9 3 4

16 4 5

23

30 5

x= hw#x out x= hw#x due

Mx= MQx out Mx= MQx due

midterms

oh oh

oh oh

oh oh

oh

oh

oh oh

oh

oh oh oh

oh

oh oh

oh = office hours oh

T

= today

T oh

(3)

from

physics

to

symbols

envelops abacus

writing numbers

(4)

from

physics

to

symbols

envelops abacus

writing numbers

starting today:

symbols to physics-computation

(5)

Today’s most important slide

0 1 0 0 1 1 1 0

m-box

Algorizms to small

syntax boxes

Syntax boxes to Boolean algebra

Boolean algebra to Physics

From ideas to physical implementation

Physical implementation of syntax boxes

with relay circuits

Claude Shannon

(6)

Boolean algebra

formulae and functions

(7)

All the coefficients are 1

Feasible for an arbitrary (finite) Boolean algebra

Simple Boolean formula

(8)

Boolean

Functions

A Boolean function is a mapping from

{B} à {B}

defined by a simple Boolean formula n

Given a Boolean algebra with a set of elements B

(9)

Start with a simple Boolean formula

Assign all possible elements to the formula

ab OR(a,b)

00 01 10 11

0 1 1 1

Two element Boolean Algebra B= {0,1}

Boolean Functions – 2 Elements

0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1

Mapping of a simple Boolean formula to a syntax box a b

(10)

+

00 01 10 11 00

01 10 11

01 01 11 11

10 11 11 11 10 11 11 11 00

01 10 11

ab OR(a,b)

00 01 10 11

0 1 1 1

Boolean Functions – 4 Elements

(11)

Assign all possible elements to the formula

ab XOR(a,b)

00 01 10 11

0 1 1 0

Two element Boolean Algebra B= {0,1}

Boolean Functions – 2 Elements

Start with a simple Boolean formula

a b

Mapping of a simple Boolean formula to a syntax box

(12)

Boolean Functions – 4 Elements

00

00

00

00 00 01 10 11 00

01 10 11

01 10 11

11 10

01

10

10 01 01

11

11

ab XOR(a,b)

00 01 10 11

0 1 1 0

(13)

Boolean algebra

DNF

|s|

(14)

D

isjunctive

DNF N

ormal

F

orm

Idea:

Representing a Boolean function with a formula of a specific form

(15)

Representation of Boolean Functions

Disjunctive (Additive) Normal Form (DNF):

Sum of terms, each term is Normal

Normal = contains all the variables or their complements

(16)

Representation of Boolean Functions

Disjunctive (Additive) Normal Form (DNF):

Sum of terms, each term is Normal

Normal = contains all the variables or their complements

Is it a DNF?

No!

This term is not normal

(17)

DNF E-Theorem

Every Boolean function can be Expressed in a DNF

(18)

Every Boolean function can be Expressed in a DNF

Expressed the following in a DNF T4

A1 A2 A4 A3 L1 T3

(19)

DNF E-Theorem

DNF E-Theorem:

Every Boolean function can be xpressed in a Proof:

Apply DeMorgan Theorem (T4) until each negation is applied to a single variable

Apply distributive axiom (A4) to get a sum of terms

Use (A3, T3) and self absorption (L1) to eliminate duplicate terms

Augment a missing variable a to a term using (A1,A2,A4) multiplying by

By the algorithm

(20)

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

xy AND(x,y)

00 01 10 11

0 0 0 1

1 iff both x and y are 1

(21)

Being Normal is Boring....

For which 0-1 assignments a normal term = 1 ?

011 101 110

A normal term is 1 for a single 0-1 assignment otherwise it is 0

Normal 0-1 assignment,

corresponds to a normal term

(22)

10 01 ab XOR(a,b)

00 01 10 11

0 1 1 0

A Boolean function is

1 for the normal 0-1 assignments and 0 for the other 0-1 assignments

Normal 0-1 assignments DNF

Boolean function syntax table

(23)

A Boolean function is 1 for the normal assignments and 0 for the other 0-1 assignments

0-1 assignments DNF

00

00

00

00

00 10 11

00 01 10 11

01 10 11

11 10

01

10

10 01 01

11

11 01

Other 0-1 assignments Normal 0-1 assignments

(24)

DNF Representation Theorem

DNF is a representation: two Boolean functions

are equal if and only if their DNFs are identical.

DNF Representation Theorem:

5 + 2 + 1 + 111 = ?? = 7+ 3 + 82+ 15 + 12

100 + 10 + 9 100 + 10 + 9

(25)

DNF Representation Theorem

DNF is a representation: two Boolean functions are equal if and only if their DNFs are identical.

Proof:

DNF Representation Theorem:

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 assignment

(26)

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 Other direction:

two different DNFs implies two different functions

The 0-1 normal assignment that ‘corresponds’ to this term results in a 1 for one DNF and in a 0 for the other.

Q

(27)

DNF is a representation: Two Boolean functions are equal if and only if their DNFs are identical.

Q: How is the all-0 function represented?

Q: How is the all-1 function represented?

Answer:

Answer: everything....

(28)

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:

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

(29)

Boolean algebra

DNF from syntax boxes

(30)

DNF is a way to express

a syntax box using a formula

Any syntax box?

Represent a syntax box with formula?

We will focus on binary

It works only for binary!

(31)

ab XOR(a,b)

00 01 10 11

0 1 1 0

Idea: construct a DNF by adding the normal terms that correspond to the normal assignments

DNF is a way to express

a syntax box using a formula normal assignment in the syntax table

=

a normal term in the DNF

(32)

ab f(a,b)

00 01 10 11

1 1 1 0

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

(33)

Boolean algebra

DNF and magic boxes

(34)

Q:Can we reason about magic boxes using

Boolean algebra?

A Boolean algebra is a language for reasoning about syntax boxes

A MAGIC BOX:

binary s-box that can

compute binary s-box?

YES

(35)

a b m

0 0

1 0

1 0

1 1

1 1 1 0

A magic box

Prove that it is magical?

with Boolean algebra?

(36)

a b m

0 0

1 0

1 0

1 1

1 1 1 0

00 01 10

A magic box

Prove that it is magical?

with Boolean algebra?

First idea: DNF of m(a,b)

(37)

a b m

0 0

1 0

1 0

1 1

1 1 1 0

A magic box

Prove that it is magical?

with Boolean algebra?

Second idea?

Compute the operations of the Boolean algebra with m(a,b)

(38)

a b m

0 0

1 0

1 0

1 1

1 1 1 0

Analyzing the Magic Box using Boolean Algebra

Can realize the operations of the algebra hence, can compute any DNF

magical for Binary

(39)

The Magic Box Can Compute any Boolean Function

? ?

? output in DNF?

(40)

0 0

The Magic Box Can Compute any Boolean Function

HW#3

(41)
(42)

2 symbol adder

digit 1 digit 2

carry

sum

carry

Binary Adder

3 bits to 2 bits

Gottfried Leibniz 1646-1716

Represent the number

of 1s in the input as two bits in base 2

(43)

s 0

1 1 0

1 0 0 1 0 0

0 0

0 1 1 0

c 0 0 0 1

d1 d2 c

0 1 0

1 0

1 0

1

0 1 1 1 1 0

0 1

1 1 1 1

parity majority

0 0 0 0

0 1 1 0

d1 d2 c

0 1 0

1 0

1 0

1 1 0

0 1

1 1 1 1

(44)

s 0

1 1 0

1 0 0 1 0 0

0 0

0 1 1 0

c 0 0 0 1

d1 d2 c

0 1 0

1 0

1 0

1

0 1 1 1 1 0

0 1

1 1 1 1

parity majority

0 0 0 0

0 1 1 0

d1 d2 c

0 1 0

1 0

1 0

1 1 0

0 1

1 1 1 1

majority 011 101 110 111

parity 001 010 100 111

(45)

2 symbol adder c

s

d1 d2

c

parity majority

In HW#3: Compute parity

and majority with magic boxes...

(46)

Shannon 1916-2001

(47)

Connection Between

Boolean Calculus and Physical Circuits Shannon 1938

Shannon 1916-2001

1 Relay on the edge

controlled by a 0-1 variable

0

~90 AB (After Boole)

(48)

Connection Between

Boolean Calculus and Physical Circuits Shannon 1938

2 relays

a b

a

b What is it computing?

ab OR(a,b)

00 01 10 11

0 1 1 1

ab AND(a,b)

00 01 10 11

0 0 0 1

connected

disconnected

When is it connected?

(49)

Next week: Implementing

Boolean

functions

with

relay circuits

Shannon 1916-2001

(50)

References

Related documents

Our estimates show that for the average Sub-Saharan African countries, at the peak, the total e¤ect of HIV/AIDS on growth is a reduction by 6% of income per capita; the e¤ect

If you completed ALL lower-division general education/breadth requirements at a UC campus PRIOR to transferring to UC San Diego, you are considered a UC Reciprocity transfer

However, they also rely on a trusted third party, called demand response provider, who is capable of tracking the bidding history of any participant for future potential

Commercial Advisor Investment Services Ryan Shapiro Commercial Advisor Jim Salkiewicz Commercial Advisor Tanner Lundberg Commercial Advisor Amanda Hopper Commercial Advisor Gino

Custom analytics track phase changes (e.g. level completions) and meaningful variables (e.g. levels scores, HUD usage and quantity of component connections

A qualitative case-study analysis was utilized to examine the research questions: (a) what role does forensic evidence play versus investigative technique in the clearance of

Disciplinary action by a medical board was also associated with low scores on the Medical College Admission Test and poor grades in the first two years of medical school (1