source: thinkgeek

24
source: http://thinkgeek.com

description

source: http://thinkgeek.com. It’s All (just) Bits. 1) Numbers are bits 2) Text is bits 3) Formatted text is bits 4) Pictures are bits. 5) Sounds are bits. Paradigm Shift?. 2. 1. Bits can be operated on!. Example: adding two bits decimal binary 0+0 = 0 = 00 - PowerPoint PPT Presentation

Transcript of source: thinkgeek

Page 1: source: thinkgeek

source: http://thinkgeek.com

Page 2: source: thinkgeek

It’s All (just) Bits1) Numbers are bits

2) Text is bits

3) Formatted text is bits

4) Pictures are bits

5) Sounds are bits

Paradigm Shift?

Page 3: source: thinkgeek

Bits can be operated on!

Example: adding two bits

decimal binary

0+0 = 0 = 0 00+1 = 1 = 0 11+0 = 1 = 0 11+1 = 2 = 1 0

2 1addends sum

built using http://logic.ly by Josh Tynjala

Page 4: source: thinkgeek

It’s All (just) Bits1) Numbers are bits

2) Text is bits

3) Formatted text is bits

4) Pictures are bits

5) Sounds are bits

6) Programs (instructions on how to operate on bits)

are also bits!

Page 5: source: thinkgeek

01

multiplexer: chooses 1 bit out of 2using bits!

data bits

output bit

selector bit

Page 6: source: thinkgeek

data bits

selectorbit

output:

equal to top data bit if selector is 0

equal to bottom data bit if selector is 1

built using http://logic.ly by Josh Tynjala

Page 7: source: thinkgeek

Computer Architecture in 1 Slide• A program is a sequence of instructions• Both data and program sit in memory (RAM)• At the heart of your computer is a processor,

which simply executes instructions in order, one at a time• A processor has a few registers

for storing intermediate results (like scratch paper)• There are only a few possible instructions and a few

registers; anything more complex is built up from there

R1 R3 R5 R7R2 R4 R6 R8

Page 8: source: thinkgeek

Example Instructions1. R1 1002. R2 93. R3 R1+R24. R8 2185. R6 R8/2

R1 R3 R5 R7R2 R4 R6 R8

100 9 109 218109

Instructions can be encoded as bits:need a code for each operation (e.g., +=1, =2, /=3)write down the operation code, the values,and the register numbers

Page 9: source: thinkgeek

• But we have lots of data; it doesn’t all fit into the few registers. It sits in memory.

• Big idea: address it.

Memory

(lots of) memory

149 159 150 151 152 153 154 155 156 157 158 … …

… …v n o n n e u m a n

Page 10: source: thinkgeek

• But we have lots of data; it doesn’t all fit into the few registers. It sits in memory.

• Big idea: address it.

Memory

load into R1 the value in memory at address 153

(lots of) memory

149 159 150 151 152 153 154 155 156 157 158 … …

118 110 111 110 32 110 101 117 109 97 110 … …

R1 R3 R5 R7R2 R4 R6 R8

110

How to choose a value by location?

Page 11: source: thinkgeek

01

multiplexer: chooses 1 bit out of 2

data bits

output bit

selector bit

Page 12: source: thinkgeek

0

0

choosing 1 bit out of 400Set selectors to:

Page 13: source: thinkgeek

1

0

choosing 1 bit out of 4Set selectors to: 01 (bottom to top)

Page 14: source: thinkgeek

1

choosing 1 bit out of 4

0

Set selectors to: 10 (bottom to top)

Page 15: source: thinkgeek

1

1

choosing 1 bit out of 4Set selectors to: 11 (bottom to top)

Page 16: source: thinkgeek

choosing 1 bit out of 8001000 010 011 100 101 110 111

Addresses:

Page 17: source: thinkgeek

1

1

0

choosing 1 bit out of 8001000 010 011 100 101 110 111

Addresses:

Page 18: source: thinkgeek

How many layers of multiplexers?

Page 19: source: thinkgeek

149 159 150 151 152 153 154 155 156 157 158 … …

118 110 111 110 32 110 101 117 109 97 110 … …

R1 R3 R5 R7R2 R4 R6 R8

110

Program using memory1. load into R1 the value in memory at address 153 2. R1 R1 32

(more layers of multiplexers)

Page 20: source: thinkgeek

149 159 150 151 152 153 154 155 156 157 158 … …

118 110 111 110 32 110 101 117 109 97 110 … …

Program using memory1. load into R1 the value in memory at address 153 2. R1 R1 323. store the value in R1 into memory at address 153

R1 R3 R5 R7R2 R4 R6 R8

78

Page 21: source: thinkgeek

149 159 150 151 152 153 154 155 156 157 158 … …

118 110 111 110 32 110 101 117 109 97 110 … …

Program using memory1. load into R1 the value in memory at address 153 2. R1 R1 323. store the value in R1 into memory at address 153

R1 R3 R5 R7R2 R4 R6 R8

78

78

demultiplexers

Page 22: source: thinkgeek

149 159 150 151 152 153 154 155 156 157 158 … …

… …

Program using memory1. load into R1 the value in memory at address 153 2. R1 R1 323. store the value in R1 into memory at address 153

R1 R3 R5 R7R2 R4 R6 R8

78

v n o n 110 e u m a n N

Page 23: source: thinkgeek

Dilbert by Scott Adams, May 8 2005

Page 24: source: thinkgeek

It’s All (just) Bits1) Numbers are bits

2) Text is bits

3) Formatted text is bits

4) Pictures are bits

5) Sound is bits

6) Programs (instructions on how to operate on bits)

are also bits!

SO WHAT?