You are on page 1of 19

Rehan Azmat

Lecture 2
Memory Organization and Hierarchy

The main memory is used to store the


program and data which are currently
manipulated by the CPU.
The secondary memory provides the longterm storage of large amounts of data and
program.
Before the data and program in the secondary
memory can be manipulated by the CPU, they
must first be loaded into the main memory.










Location
Capacity
Unit of transfer
Access method
Performance
Physical type
Physical characteristics
Organisation





CPU
Internal
External

Word size
The natural unit of organisation

Word Length
8,16 or 32 bits

Internal
Usually governed by data bus width

External
Usually a block which is much larger than a word

Addressable unit
Smallest location which can be uniquely addressed
Word internally
Cluster on disks

Sequential
Start at the beginning and read through in order
Access time depends on location of data and
previous location
e.g. tape

Direct
Individual blocks have unique address
Access is by jumping to vicinity plus sequential
search
Access time depends on location and previous
location
e.g. disk

Random
Individual addresses identify locations exactly
Access time is independent of location or previous access
e.g. RAM

Associative
Data is located by a comparison with contents of a portion
of the store
Word is accessed based on its contents rather then address
Access time is independent of location or previous access
e.g. cache

Access time
Time between presenting the address and getting
the valid data

Memory Cycle time


Time may be required for the memory to recover
before next access
Cycle time is access + recovery

Transfer Rate
Rate at which data can be moved into or out from
memory unit

Semiconductor
RAM

Magnetic
Disk & Tape

Optical
CD & DVD

Others
Bubble
Hologram

Memory bandwidth denotes the amount of data that can be


accessed from a memory per second:

There are two basic techniques to increase the bandwidth of a


given memory:
Reduce the memory cycle time
Expensive
Memory size limitation
Divide the memory into several banks, each of which has its
own control unit.

What do we need?
A memory to store very large programs and to work at a speed
comparable to that of the CPU.

The reality is:


the larger a memory, the slower it will be;
the faster the memory, the greater the cost/bit.

A solution:
To build a composite memory system which combines a small
and fast memory with a large and slow memory, and behaves
(most of the time) like a large fast memory.

The two level principle above can be extended into a


hierarchy of many levels.
The effectiveness of such a memory hierarchy is based on
property of programs called the locality of reference.

During the course of the execution of a


program, memory references tend to cluster
e.g. Instruction: Loops
e.g. Data: arrays

You might also like