Você está na página 1de 45

COMPUTER

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

Memory addresses are defined using unsigned binary


integers.
Memory Access
■ Memory Access: The time required to read from and
write into the memory.
■ Volatile and Non-volatile:
– Volatile: stored information is destroyed when
power goes off.
– Non-volatile: retains the content even after the
power failure.
■ Destructive and non destructive:
– Destructive: the memory content is lost when it is
read.
– Non destructive: the content remains in the
memory even after the read operation.
Memory Access
■ Access type:
– Serial Access: storage locations can be access
only in predetermined sequences.
– Random Access: storage locations can be
accessed in any order.
■ Static RAMs: store data as long as the power supply
continues regardless of the duration since the data
was written into.
– Low packing density and costly
■ Dynamic RAMs: data in the memory cells will be lost
after some time. The data is restored through
refreshing.
**ROM,PROM,EPROM
■ Non-volatile memories retain value even if power
goes off.
– Generic name is read-only memory (ROM).
■ Misleading because some ROMs can be read and
modified.
■ Firmware (Program instruction used frequently)
– Program stored in a ROM
■ Boot time code, BIOS (basic input/output system)
■ graphics cards, disk controllers.
(Didn’t get what are written)
Types of ROMs
■ Types of ROMs
– Programmable ROM (PROM): can be written once
only.
– Erasable programmable ROM (EPROM): the
contents can be erased and re-written.
– Electrically erasable PROM (EEPROM): similar to
EPROM but the underlying technology is different
– Flash memory (used in portable digital devices)
**Magnetic Core Storage
■ Types of ROMs
– Programmable ROM (PROM): can be written once
only
– Erasable programmable ROM (EPROM): the
contents can be erased and re written
– Electrically erasable PROM (EEPROM): similar to
EPROM but the underlying technology is different
– Flash memory (used in portable digital devices)
There are some problems in this slide. Previous topics
are repeated by mistake.
Should be Read from Book ( Page no. 77 to 79).
Memory Types(At a glance)
■ RAM (Random access memory):
– SRAM (Static RAM) (flip-flop gates)
– DRAM (Dynamic RAM)
■ ROM (Read only memory)
– PROM (programmable)
– EPROM (erasable programmable)
– EEPROM (electronically erasable programmable)
Secondary Memory (or Storage)
■ Storage devices hold data, even when the computer is
turned off.
■ The physical material that actually holds data is called a
storage medium. The surface of a floppy disk is a
storage medium.
■ The hardware that writes data to or reads data from a
storage medium is called a storage device. A floppy disk
drive is a storage device.
■ The two primary(??)(It should be secondary) storage
technologies are
– magnetic and
– optical.
Characteristics of Secondary
Memory
■ Common characteristics of secondary storages are:
– Non-volatile storage
– Mass storage
– Cost efficient
– Lack of direct processing capability
■ Information in secondary storage are not accessible to
the CPU or the input/output devices. They must be
routed through primary memory.
Primary Vs Secondary Storages
Primary Storage Secondary Storage
Cost Most expensive Less expensive than Primary
storages
Capacity Limited More than primary storage
Access time In billionth of a second In millionth of a second
Processing Directly accessible to the Not directly accessible to the
CPU CPU
Media of Semiconductor, magnetic Magnetic tape, magnetic disk
storing core
Location Within CPU Outside but connected to the
CPU
Types of Secondary Memory
■ Based on mode of access:
– Sequential access storage: to read a record, all the
records preceding it must be read
– Direct access storage: an individual record can be
read immediately without reading any other
records.
■ Auxiliary Storage Devices-
– Magnetic Tape, Hard Disk, Floppy Disk
■ Optical Disks:
– CD-R Drive, CD-RW disks, DVD, Blue ray Discs.
Types of Secondary Memory
• Magnetic
– Floppy disks
– Zip disks
– Hard drives
• Optical
– CD-ROM
– DVD
• Solid state storage devices
– USB Key (a very common form of solid state
storage)
CLASSIFICATION- BIG PICTURE
Registers
2ns
Cache (I, II, III)
Volatile SRAM
DRAM
Primary SDRAM
(Semiconductor – RAM EDRAM
chip). Main Memory
EDO
Memory Types & FLASH RAM

Storage Devices PROM


Non-volatile EPROM
ROM EEPROM
Tape
Magnetic memory HD, Zip Disk
Secondary FDD
(Devices)
Optical
CD-ROM, CD-R, CD-RW
Memory DVD-ROM, DVD-R 5ms
DVD- RW
Magnetic Storage
■ Exploits duality of magnetism and electricity
– Converts electrical signals into magnetic charges
– Captures magnetic charge on a storage medium
– Later regenerates electrical current from stored
magnetic charge

■ Polarity of magnetic charge represents bit values zero


and one
Magnetic Tape

■ The first truly


mass auxiliary
storage device
was the magnetic
tape drive
Magnetic Tape
■ Magnetic tape is a Sequential Access Storage Device.
■ The tape is made up of plastic material (mylar) coated
with iron oxide magnetizable material.
■ The tape vary from ½ inch to 1 inch in width and is
divided into horizontal rows called channels or tracks.
■ (Figure 6.6 in the book)
Surface organization of a tape
Magnetic Tape
■ The components of a tape drive:
– Tape reel holders
– A tape drive mechanism
– Read, write and erase heads
– Tape reservoirs to ensure clean and even tape
movement.
■ A nine track tape drive has 9 read/write heads.
Recording Density
■ The recording density is measured by the number of bits
per inch for a single track.
■ A density of 1600 bpi means there are 1600X8 bits in
which 1600 characters can be written.
■ A tape contains multiple files but we are interested to read
a single file, most often a part of a file.
■ A file is divided into many records. There are some blank
space between each records, typically 0.5 inch to 0.75 inch
– Inter record gap (IRG)
■ To increase the utilization of tape a block (containing a
group of blocks) is read at a time.
■ The gap between blocks is known as Inter block gap (IBG)
Advantages and Disadvantages of
Magnetic Tape
■ Advantages
– Relatively less expensive
– Large storage capacity
– Compact i.e., easy to store
– Convenient to carry information from one place to another
– Reusable
■ Disadvantages
– Serial access i.e., slower
– Updated information cannot be written on the previous location
– Prone to error due to dust, humidity and temperature.
– Data transmission is slower
– Too much operating time
Magnetic Disk

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).

• Each particle's direction represents a 1 (on) or 0 (off),


representing each bit of data that the CPU can recognize.

• A disk drive uses read/write heads containing


electromagnets to create magnetic charges on the
medium.
As the medium
rotates, the head
writes the data.
Magnetic Storage Devices - Diskettes
• Diskette drives, also known as floppy disk drives, read
and write to diskettes (called floppy disks or floppies).

• In disks the areas to save data are organized as a set of


concentric circles called Tracks. Floppy disks have 80
tracks. The disks are further divided into pie-slice
Sectors.

• 300 rpm

• Diskettes size: 3.5-inch.


Hard Disk Drive
■ Purpose:
– Long-term, nonvolatile storage
– Large, inexpensive, slow level in the storage hierarchy

■ 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

Magnetic Tape | Optical 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

Você também pode gostar