Monday, February 7, 2011

lecture #3

lecture 3

memory

bit = binary digit. 0 and 1
binary: base 2

in base n, the digits go from 0 to n-1

RAM - random access memory
using electricity
volatile
short term memory

hard disk drive, floppy disk, CD-ROM
ROM - means read only memory
these are long-term memory
not volatile

now we know how you might store a bit

how do we encode bigger numbers?

http://en.wikipedia.org/wiki/Magnetic_tape

random access memory
book
sequential access memory
scroll

that is why we copy program from long-term memory to short term before running

metaphor
sequential access
*VHS tapes
random access
*DVD

1 bit = 2 possible value
0, 1

2 bits = 4
00
01
10
11

how many possible outfits
5 pants
8 shirts

40
5 x 8
simple combinatorics

3 bits = 8 possible values
000
001
010
011
100
101
110
111

2 x 2 x 2
2^3

4 bits = 16 possibilities = 2^4
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
10= 1010
11= 1011
12= 1100
13= 1101
14= 1110
15= 1111

n bits, store 2^n possible values

8 bits = byte
4 bits = nibble
2 bytes = word
4 bytes = dword

1024 bytes = 1 kilobyte (kb) = 2^10 bytes

why 2^10 rather than 10^3?
because if we store a memory address in memory, why waste space? you can store 1024 different positions. we operate in base 2.

1024 x 1024 bytes = 2^20 bytes = 1 megabyte
2^30 bytes = gigabyte
2^40 bytes = terabyte

manufacturers redefined terms to mean powers of 10

trilobite; nothing to do with CS

http://en.wikipedia.org/wiki/Terabyte

speed in hertz
kilohertz, megaherz, gigahertz
http://en.wikipedia.org/wiki/Gigahertz

http://en.wikipedia.org/wiki/Von_Neumann_architecture

swap file

No comments:

Post a Comment