Top Banner
1 February 5th, 2016 Dave Abel Unit 1: The Model of the Computer
103

Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Jun 06, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

1

February 5th, 2016

Dave Abel

Unit 1: The Model of the Computer

Page 2: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Today’s Takeaway

2

‣ Earlier this week: computers are doing logic with gates!

‣ Today: Memory, Logic, and input/output = Computer!

Page 3: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Outline for Today

3

‣ Review of Gates

- AND, OR, NOT, Composite Gates

- Domino Gates, XOR, Adding with Gates

‣ State Machines!

‣ Model of a Computer

Page 4: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

4

Gates: NOT

1 0N

ot

0 1

P NOT(P)

1 0

0 1

Not

Page 5: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

5

Gates: NOT

Not

1 0

Q: What is this, physically?

Page 6: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

6

Gates: NOT

Not

1 0

Q: What is this, physically?

A: High voltage electrical pulses!

Page 7: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

7

Gates: NOT

1 0

Page 8: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

8

Gates: NOT

P NOT(P)

1 0

0 1

1 0

0 1

Page 9: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

9

Gates: ANDP Q AND( P Q)

1 1 1 1 1

1 0 0 1 0

0 1 0 0 1

0 0 0 0 0

AND

1

1AND(P,Q) = 1

Page 10: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

10

Gates: ORP Q OR( P Q)

1 1 1 1 1

1 0 1 1 0

0 1 1 0 1

0 0 0 0 0

OR

OR(P,Q) = 10

1

Page 11: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

11

Gates

OR

P

Q

OR(P,Q)

AND

P

Q

AND(P,Q)

Not

P NOT(P)

Page 12: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

12

Gates: Composition

OR(P,NOT(Q))

A: OR

POR(P,NOT(Q))

Not

Q NOT(Q)

P Q OR( P NOT( Q)

T T T T F T

T F T T T F

F T F F F T

F F T F T F

Page 13: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Domino Gates

13

P

Q

OR(P,Q)

Page 14: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

14

Domino Gates

Page 15: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Could It Work?

15

‣ Michael’s domino OR gate: 24 dominoes

‣ The first pentium processor had 3.3 Mill transistors, or roughly 800k gates.

‣ So we need around 20 Mill dominoes

‣ World record for domino topple: 4.5 Mill

‣ Pentium: computes 60 Mill times a second

‣ Dominoes? Takes awhile to set up…

Page 16: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Two Different Notions of Speed

16

1. Electricity vs. Dominos falling over

2. Do we have the shortest computation for that problem?

Page 17: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

17

P NOT(NOT(P))=

Page 18: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

18

P NOT(NOT(P))

# of Gates: 0 2

Page 19: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

19

P NOT(NOT(NOT(NOT(P))))

# of Gates: 0 4

Page 20: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

20

P NOT(NOT(NOT(NOT(NOT(P)))))

# of Gates: 0 6

Page 21: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

21

P NOT(NOT(NOT(NOT(NOT(P)))))…….

# of Gates: 0 6024

Page 22: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

22

P NOT(NOT(NOT(NOT(NOT(P)))))…….

# of Gates: 0 6024

Think about that many domino gates…

Page 23: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Problem: Speed!

23

P NOT(NOT(NOT(NOT(NOT(P)))))…….

# of Gates: 0 6024

Identical logical formulas, dramatically different speed of computation!

Think about that many domino gates…

Page 24: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

24

One Last Gate… XORP Q XOR( P Q)

1 1 0 1 1

1 0 1 1 0

0 1 1 0 1

0 0 0 0 0

XOR

Page 25: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

25

One Last Gate… XORP Q XOR( P Q)

1 1 0 1 1

1 0 1 1 0

0 1 1 0 1

0 0 0 0 0

Page 26: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

26

One Last Gate… XORP Q XOR( P Q)

1 1 0 1 1

1 0 1 1 0

0 1 1 0 1

0 0 0 0 0

XOR

Page 27: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

27

Arithmetic and LogicWe know how to do addition, subtraction, and

multiplication in binary…

But we’ve claimed that computers used AND, OR, NOT gates at their core to do everything…

Page 28: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

28

Arithmetic and LogicWe know how to do addition, subtraction, and

multiplication in binary…

But we’ve claimed that computers used AND, OR, NOT gates at their core to do everything…

Q: Can we represent addition with logical gates?

Page 29: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

29

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

Q: Can we represent addition with logical gates?

Page 30: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

30

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

Hint: you’ll need these:

AND

Q: Can we represent addition with logical gates?

Page 31: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

31

Arithmetic and Gates

XOR

AND

topNumber

bottomNumbertwo’s digit

one’s digit

A:

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

Page 32: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

32

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

0

0two’s digit

one’s digit

A:

Page 33: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

33

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

0

0two’s digit

one’s digit

A:

Page 34: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

34

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

0

0two’s digit

0

A:

Page 35: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

35

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

0

0two’s digit

0

A:

Page 36: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

36

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

0

00

0

A:

Page 37: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

37

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

1two’s digit

one’s digit

A:

Page 38: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

38

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

1two’s digit

one’s digit

A:

Page 39: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

39

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

1two’s digit

0

A:

Page 40: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

40

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

1two’s digit

0

A:

Page 41: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

41

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

11

0

A:

Page 42: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

42

Arithmetic and Gates

0+ 00 0

1+ 00 1

0+ 10 1

1+ 11 0

1

XOR

AND

1

11

0

A:

Page 43: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Binary Adder

Page 44: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

44

Truth Table to Formula

Idea: with a certain set of logical functions, we can represent all

possible logical formulas!

Page 45: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

45

Truth Table to Gate

Idea: with a certain set of logical functions gates, we can represent all

possible logical formulas!

Page 46: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Abstraction:

46

OR

P

Q

OR(P,Q)

AND

P

Q

AND(P,Q)

Not

P NOT(P)

all possible logical

formulas!

Page 47: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Abstraction:

47

Low level programs

Page 48: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Abstraction:

48

Low level programs

High level programs

Page 49: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Abstraction:

49

Low level programs

High level programs

Your ideas!=

Page 50: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines

50

Page 51: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

51

Suppose we want a blinking christmas light:

Page 52: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

52

Suppose we want a blinking christmas light:

O = was the light on a second ago?N = is the light on now?

Page 53: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

53

oldLight = was the light on a second ago?

Suppose we want a blinking christmas light:

newLight = is the light on now?

Page 54: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

54

oldLight = was the light on a second ago?

Suppose we want a blinking christmas light:

newLight = is the light on now?Q: How can we write the value of newLight in

terms of oldLight?

Page 55: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

55

oldLight = was the light on a second ago?

Suppose we want a blinking christmas light:

newLight = is the light on now?

A: newLight = NOT(oldLight)

Page 56: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

56

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 57: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

57

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 58: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

58

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 59: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

59

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 60: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

60

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 61: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

61

Suppose we want a blinking christmas light:

A: newLight = NOT(oldLight)

Not

newLightoldLight

…1 second delay

Page 62: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

State Machines: Example

62

Suppose we want a blinking christmas light:

ONSTATE

OFFSTATE

Page 63: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

63

Page 64: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

64

isPersonLeft isPersonRight

Page 65: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

65

isPersonLeft isPersonRight

Page 66: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

66

isPersonRightisPersonLeft

Page 67: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

67

isPersonRightisPersonLeft

Page 68: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

A More Complicated Example: Sliding Doors

68

isPersonRightisPersonLeft

OR doorOpen

Page 69: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

69

Page 70: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

70

Page 71: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

71

OR(left,right)

Page 72: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

72

OR(left,right)

NOT(OR(left,right))

Page 73: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

73

OR(left,right)

NOT(OR(left,right))

left = 0right = 0Memory:

readread

Page 74: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

74

Q: How else can we write this with logic?

NOT(OR(left,right))

OR(left,right)

Page 75: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

A More Complicated Example: Sliding Doors

75

Q: How else can we write this with logic?A: AND(NOT(left),NOT(right))

NOT(OR(left,right))

OR(left,right)

Page 76: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Side Note: DeMorgan’s Law

76

NOT(OR(left,right))

AND(NOT(left),NOT(right))

=

Page 77: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Side Note: DeMorgan’s Law

77

P Q AND( NOT(P) NOT(Q))

1 1 0 0 01 0 0 0 10 1 0 1 00 0 1 1 1

P Q NOT( OR(P,Q))

1 1 0 11 0 0 10 1 0 10 0 1 0

Page 78: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Side Note: DeMorgan’s Law

78

P Q AND( NOT(P) NOT(Q))

1 1 0 0 01 0 0 0 10 1 0 1 00 0 1 1 1

P Q NOT( OR(P,Q))

1 1 0 11 0 0 10 1 0 10 0 1 0

Page 79: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

State Machines: Sliding Doors

79

Page 80: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

DOORCLOSED

DOOROPEN

State Machines: Sliding Doors

80

Sensors! Input! Reading from Memory!

Page 81: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

81

‣ Internal states (memory)

‣ Complex logic relating bits/information

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Page 82: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

82

Page 83: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

83

Page 84: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

84

Page 85: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

85

Page 86: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

86

https://xkcd.com/505/

Page 87: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

87

Alonzo Church Alan Turing

Page 88: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

88

“There is only one notion of computation”

Page 89: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

89

“There is only one notion of computation”

(and anything with these properties is doing it)

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Page 90: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

90

“There is only one notion of computation”

Things that can be computed, period.

Page 91: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

91

“There is only one notion of computation”

Things that can be computed, period.

Things a domino computer could compute

before the sun goes supernova

Page 92: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

92

“There is only one notion of computation”

Things a regular computer can compute before the

sun goes supernova

Things that can be computed, period.

Things a domino computer could compute

before the sun goes supernova

Page 93: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

93

“There is only one notion of computation”

Things a regular computer can compute before the sun

goes supernova

Things that can be computed, period.

Things a domino computer could compute before the

sun goes supernova

Q: What, if anything, is out here?

Page 94: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

94

“There is only one notion of computation”

Things a regular computer can compute before the sun

goes supernova

Things that can be computed, period.

Things a domino computer could compute before the

sun goes supernova

???

Q: What, if anything, is out here?

Page 95: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

95

“There is only one notion of computation”

Things a regular computer can compute before the sun

goes supernova

Things that can be computed, period.

Things a domino computer could compute before the

sun goes supernova

???

A: Theory unit!

Q: What, if anything, is out here?

Page 96: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Church-Turing Thesis

96

“There is only one notion of computation”

‣ Some other questions:

- Is the human brain carrying out computation?

- Is the comic right? Or are there things in the world that feel like they aren’t computation?

- Is “randomness” computable? How?

- Is there one “fastest” model of a computer? (e.g. X is to the transistor as the transistor is to the domino)

Page 97: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

97

‣ Internal states (memory)

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Page 98: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

98

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Page 99: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

99

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Memory

Page 100: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

100

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Memory

CPU

Page 101: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

101

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Memory

CPU

Mouse

Keyboard

Page 102: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

The Computer

102

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Q: What are these in our computers?

Memory

CPU

Mouse

Keyboard

Monitor

Page 103: Unit 1: The Model of the Computer - david-abel.github.io · ‣ State Machines! ... ‣ Michael’s domino OR gate: ... Identical logical formulas, dramatically different speed of

Next Time

103

‣ Internal states

‣ Complex logic relating bits

‣ Mechanism for setting bits (input)

‣ Mechanism for displaying bits (output)

Memory

CPU

Mouse

Keyboard

Monitor

Programming lets us define the

“complex logic”!