Professional Documents
Culture Documents
MEMORY
Reading: Chapter 6 of Elements of Computer Science
and this slide
Memory Unit
■ The instruction and data are stored in the memory unit
of a computer.
■ The memory components can be divided into:
– Main Memory (Primary Memory)
– Secondary Memory (Secondary or Auxiliary
Memory)
– Internal Processor Memory
■ Need for memory
– To store program and data during execution
– To store the program for repetitive use
– To data for future use
– To store the result of execution
Main Memory
■ The main memory consists of various storage locations
to store some bits (corresponding to the word length).
■ Units of memory:
– Bit – the smallest unit
– Nibble – collection of 4 bits
– Byte – collection of 8 bits
– Word Length – the number of bits that can be
processed by the CPU at a time
■ The size of the memory is expressed by the total
number of storage locations and is expressed in
kilobytes (KB) or megabytes (MB).
Main memory
Example 1
A computer has 32 MB (megabytes) of
memory. How many bits are needed to address
any single byte in memory?
Solution
The memory address space is 32 MB, or 225
(25 x 220).
This means you need log2 225 or 25 bits, to
address each byte.
Example 2
A computer has 128 MB of memory. Each word
in this computer is 8 bytes. How many bits are
needed to address any single word in memory?
Solution
The memory address space is 128 MB, which
means 227. However, each word is 8 (23) bytes,
which means that you have 224 words. This
means you need log2 224 or 24 bits, to address
each word.
Memory Units
Unit Exact Number of bytes Approximation
------------ ------------------------ ------------
kilobyte 210 bytes 103 bytes
megabyte 220 bytes 106 bytes
gigabyte 230 bytes 109 bytes
terabyte 240 bytes 1012 bytes
petabyte 250 bytes 1015 bytes
exabyte 260 bytes 1018 bytes
27
Magnetic Disk
■ Flat, circular platter coated with ferromagnetic material
that is rotated beneath read/write heads
■ Random access device; read/write head can be moved to
any location on the platter
■ Hard disks and floppy disks
■ Cost performance leader for general-purpose
on-line secondary storage
Magnetic Disks
■ A read/write head travels across a spinning magnetic disk,
retrieving or recording data
Magnetic Storage Devices
- How Magnetic Storage Works
• A magnetic disk's medium contains iron particles, which
can be polarized—given a magnetic charge—in one of two
directions (north or south).
• 300 rpm
■ Disk composition
– A magnetic disk(??) consist of a collection of platters (1to 20 per
disk) that rotate on a spindle.
– Disk surface divided into tracks (1000 to 4800 per platter).
– Tracks are divided into sectors (64 per track), which are the
smallest unit that can be read or written.
■ Up to 10,000 rpm
Access Time
■ Data are stored cylinder by cylinder. In order to retrieve a record
following steps are performed:
– Identify the address of the record – cylinder number, surface
number and sector number
– Head is positioned in the appropriate cylinder and data are read.
■ Access time is composed of:
– Seek time: time required by the access arm to reach specified
cylinder.
– Latency time: time required disk pack to position correct sector
under the head.
– Transfer rate: time to transfer data from disk to CPU
*read detail from the book.
3.5 inch
floppy
and drive
Structure Of Floppy Disks
■ Initially Floppy disks were 8-inches wide, they then
shrank to 5.25 inches, and today the most widely
used floppy disks are 3.5 inches wide and can
typically store 1.44 megabytes of data.
■ A folly disk is a magnetic disk, which means that it
used magnetic patterns to store data.
■ Data in floppy disks can be read from and written to.
■ Formatting is the process of preparing a disk for
reading and writing.
■ A track is a narrow recording band that forms a full
circle on the surface of the disk.
36
Optical Disk
■A rotating disk coated with highly reflective material.
■An optical drive uses reflected light to read data.
■To store data, the disk's metal surface is covered with tiny
dents (pits) and flat spots (lands), which cause light to be
reflected differently.
–When an optical drive shines light into a pit, the light
cannot be reflected back. This represents a bit value of
0 (off).
–A land reflects light back to its source, representing a
bit value of 1 (on).
1 0
Optical Storage Devices
■ CD-ROM: compact disc ROM (Read Only Memory)
– Capacity: 650MB~700MB
■ CD-R: compact disc recordable
■ CD-RW: compact disc rewritable
■ DVD: digital versatile disc
– Capacity: 4.7GB – 17GB
■ DVD-R
■ DVD-RW (2 versions: + (plus) and
– (dash)
CD- ROM
■ A compact disk (CD) is a flat round, portable storage
medium that is usually 4.5~4.75 inch in diameter.
■ Each disk contains 16000 tracks per inch.
■ A CD-ROM (read only memory), is a compact disc that
used the same laser technology as audio CDs for
recording music.
■ It can contain other types of data such as text,
graphics, and video too.
■ The capacity of a CD-ROM is 650 MB of data.
WORM
■ WORM: Write Once Read Many
■ Data can be written only once, cannot be erased or
changed.
■ Usually used for backups and archiving.
■ Access time is grater than magnetic disks but less than
microfilm.
Erasable Optical Disk
■ WORM: Write Once Read Many
■ Uses both laser and magnetic head to read and write
data.
■ Recorded using lasers heat magnetized disk
(magnetism provides polarity) surface coated with
various metals.
■ Data are erased by shooting a more powerful laser at
the disk which reverses the polarity.
Peripheral Storage Media Primary Functions Speed and Capacity Advantages/
Equipment disadvantages
Magnetic disk Magnetic disk Secondary storage Access time: 10-100 Large capacity,
drive Disk pack (direct access) msData Transfer: 200,000 fast direct access
Fixed disk Input/output to 5 million bps
Capacity: 10 million to 15 Relatively
billion bytes per drive expensive
Floppy disk Magnetic Secondary storage Access time: 100-600 ms Small, inexpensive
drive diskette (direct access) Data Transfer: 10,000 to and convenient
Input/output 30,000 bps
Capacity: 360,000 to Slower and less
several million bytes per capacity than
disk other DASDs
Magnetic tape Magnetic tape Secondary storage Data Transfer: 15,000 to 2 Inexpensive, fast
drive reel (sequential million bytes/second data transfer
access) Capacity: upto 1 billion
Input/output bytes per tape Only sequential
Disk backup access
Optical disk Secondary storage Access time: 30-200 mili Large capacity,
drive (direct access) second high quality
Disk backup Data Transfer: 150,000 to storage
500,000 bytes/second
Capacity: CD: upto 700 Primarily read only
million; WORM: upto 3 medium
billion; erasable: upto 1
billion bytes per drive
Memory and the Memory
Pyramid
Registers
Capacity Cost
Cache &
Disk backup
Speed
Main Remory
Magnetic Disk
5-44
Registers
■ Registers can be general purpose and specific purpose
■ General purpose registers can be used for various
operations
■ Specific purpose:
– Accumulator
– Program counter (PC)
– Memory Address Register (MAR)
– Memory Buffer Register (MBR)
– Instruction Register (IR)
– Input/Output Register