cs 111 – aug. 30 1.2 – 1.3 –information arranged in memory –types of memory –disk...

7
CS 111 – Aug. 30 1.2 – 1.3 Information arranged in memory Types of memory Disk properties Commitment for next day: Read pp. 38-40, 45-47. In other words, only the parts of 1.4 and 1.5 dealing with numbers and text

Upload: eleanore-davidson

Post on 28-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

CS 111 – Aug. 30

• 1.2 – 1.3– Information arranged in memory– Types of memory– Disk properties

• Commitment for next day:– Read pp. 38-40, 45-47. In other words, only the parts

of 1.4 and 1.5 dealing with numbers and text

Page 2: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

Memory units

• Bit = a single 0 or 1 value• Nibble = 4 bits = 1 hexadecimal digit

• Byte = 8 bits

• Kilobyte (KB) = 210 bytes• Megabyte (MB) = 220 bytes• Gigabyte (GB) = 230 bytes• Terabyte (TB) = 240 bytes

• 210 = 1024, though 1000 is a close approx.

Page 3: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

CPU and memory

• CPU’s job is to obey instructions and do calculations• Memory system stores information for current and future

use– CPU has tiny number of “registers” for calculations– main memory (RAM) stores all files currently open– Secondary memory (e.g. hard drive) is for long-term

storage of files– Backup system: tape, external hard drive

• Other types of memory:– Cache, between CPU and RAM– Removable drive, e.g. USB or DVD

Page 4: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

RAM

• Runs on electricity: volatile but fast• Each byte is numbered and addressable

– Capable of holding a single character or small #

Address Contents

0 “c”

1 “a”

2 “t”

3 9

4 25

5 100

… …

Page 5: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

Memory comparison

Type Size Access time Cost per MB

CPU registers 256 bytes 1 ns N/A

Cache 64 KB 2 ns $ 20

RAM 512 MB 50 ns $ 0.20

Disk 200 GB 100,000 ns $ 0.0002

Numbers are approximate.“ns” means nanosecond = 1 billionth of a second

Page 6: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

Disk geometry

• Tracks• Sectors• Platters

• Hard drive

• Ex. A DVD has roughly 50,000 tracks and 40 (2KB) sectors per track.

Page 7: CS 111 – Aug. 30 1.2 – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp. 38-40, 45-47. In other

Disk access time

Analogous to a record player:• Seek time: read-write head moves to find the

correct track (up to ~ 8ms)

• Latency: wait for disk to rotate to beginning of file (up to ~ 4ms)

• Transfer: grab info from disk (e.g. 1 MB/sec read or 0.1 MB/sec write)