240 likes | 398 Views
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 = 0 0
E N D
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 = 0 0 0+1 = 1 = 0 1 1+0 = 1 = 0 1 1+1 = 2 = 1 0 addends sum built using http://logic.ly by Josh Tynjala
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 6) Programs (instructions on how to operate on bits) are also bits!
multiplexer: chooses 1 bit out of 2using bits! data bits 0 1 selector bit output bit
data bits output: equal to top data bit if selector is 0 equal to bottom data bit if selector is 1 selectorbit built using http://logic.ly by Josh Tynjala
R1 R2 R3 R4 R5 R6 R7 R8 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 registersfor 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
Example Instructions 1. R1 100 2. R2 9 3. R3 R1+R2 4. R8 218 5. R6 R8/2 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 100 218 109 109 9 R1 R2 R3 R4 R5 R6 R7 R8
… 149 150 151 152 153 154 155 156 157 158 159 … v o n n e u m a n n Memory • But we have lots of data; it doesn’t all fit into the few registers. It sits in memory. • Big idea: address it. … … (lots of) memory
R1 R2 R3 R4 R5 R6 R7 R8 Memory How to choose a value by location? • But we have lots of data; it doesn’t all fit into the few registers. It sits in memory. • Big idea: address it. load into R1 the value in memory at address 153 … 149 150 151 152 153 154 155 156 157 158 159 … … 118 111 110 32 110 101 117 109 97 110 110 … (lots of) memory 110
multiplexer: chooses 1 bit out of 2 data bits 0 1 selector bit output bit
choosing 1 bit out of 4 Set selectors to: 00 0 0
choosing 1 bit out of 4 Set selectors to: 01 (bottom to top) 1 0
choosing 1 bit out of 4 Set selectors to: 10 (bottom to top) 0 1
choosing 1 bit out of 4 Set selectors to: 11 (bottom to top) 1 1
choosing 1 bit out of 8 000 001 010 011 100 101 110 111 Addresses:
choosing 1 bit out of 8 000 001 010 011 100 101 110 111 Addresses: 1 1 0
R1 R2 R3 R4 R5 R6 R7 R8 Program using memory 1. load into R1 the value in memory at address 153 2. R1 R1 32 … 149 150 151 152 153 154 155 156 157 158 159 … … 118 111 110 32 110 101 117 109 97 110 110 … (more layers of multiplexers) 110
R1 R2 R3 R4 R5 R6 R7 R8 Program using memory 1. load into R1 the value in memory at address 153 2. R1 R1 32 3. store the value in R1 into memory at address 153 … 149 150 151 152 153 154 155 156 157 158 159 … … 118 111 110 32 110 101 117 109 97 110 110 … 78
R1 R2 R3 R4 R5 R6 R7 R8 Program using memory 1. load into R1 the value in memory at address 153 2. R1 R1 32 3. store the value in R1 into memory at address 153 … 149 150 151 152 153 154 155 156 157 158 159 … 78 … 118 111 110 32 110 101 117 109 97 110 110 … demultiplexers 78
R1 R2 R3 R4 R5 R6 R7 R8 Program using memory 1. load into R1 the value in memory at address 153 2. R1 R1 32 3. store the value in R1 into memory at address 153 … 149 150 151 152 153 154 155 156 157 158 159 … N v o n 110 e u m a n n … … 78
It’s All (just) Bits SO WHAT? 1) 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!