source: thinkgeek

Post on 05-Jan-2016

25 views 0 download

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

source: http://thinkgeek.com

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?

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

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!

01

multiplexer: chooses 1 bit out of 2using bits!

data bits

output bit

selector bit

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

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

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

• 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

• 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?

01

multiplexer: chooses 1 bit out of 2

data bits

output bit

selector bit

0

0

choosing 1 bit out of 400Set selectors to:

1

0

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

1

choosing 1 bit out of 4

0

Set selectors to: 10 (bottom to top)

1

1

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

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

Addresses:

1

1

0

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

Addresses:

How many layers of multiplexers?

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)

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

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

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

Dilbert by Scott Adams, May 8 2005

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?