You are on page 1of 37

MEMORY ORGANIZATION

MEMORY HIERARCHY
Auxiliary memory
Magnetic
taps

I/O
processor

Main
memory

Magnetic
disks

CPU

Cache
memory

MEMORY HIERARCHY
SYSTEM

It is an essential component in a digital computer -needed for storing programs


and data.
Memory hierarchy system consists of

relatively faster main memory


Only programs currently needed by the processor resides in main memory.

Devices that provide backup storage- Auxiliary Memory


Example: Magnetic disks and tapes
which is used for storing system programs, large data files and other backup
information.

Smaller and faster cache memory


holds those parts of the program which are heavily used

GOAL

Goal of using memory hierarchy is to obtain the highest- possible average


access speed while minimizing the total cost of the entire memory system.

MEMORY CAPACITY

2n x m
n address bits = 2n addresses
m data bits
m is the width of the data path

Q: How many bits of memory are contained in a


memory unit with 2MB of memory?
A: 2 = 21, M = 220, B = byte = 8 = 23
21 x 220 x 23 = 224 = 16,777,216

DATA BUS
Carries data between the CPU and memory or I/O devices
Bi-directional
Data transferred out of the CPU for write operations
Data transferred into the CPU for read operations
Typical sizes: 8, 16, 32, 64 lines
Signal names:
D0, D1, D2, D3, etc.

ADDRESS BUS
Carries an address from the CPU to Memory or I/O devices
Unidirectional
The address is always supplied by the CPU
Typical sizes: 16, 20, 24 lines
Signal names:
A0, A1, A2, A3, etc.

CONTROL BUS

Collection of signals for coordinating CPU activities


Each signal has a unique purpose
Signals are output, input, or bi-directional
Typical signals
/RD (read)
/WR (write
CLK (clock)
/IRQ (interrupt request)
etc.

MEMORY ADDRESS MAP

The usage of memory space on a system is commonly


depicted in a memory map
The height of the map is determined by the number of
addresses
The width of the map is usually 8 bits
E.g.,
a system with a capacity of 216 bytes

MEMORY UNIT

MAIN MEMORY

It is the central storage unit in a computer system


Relatively large and fast memory used to store programs and data
during the computer operations.

Memory implementations
RAM random access memory
Static RAM
Dynamic RAM
ROM read-only memory

RANDOM ACCESS MEMORY

Static RAM (SRAM)


Each cell stores bit with a six-transistor circuit.
Retains value indefinitely, as long as it is kept powered.
Relatively insensitive to disturbances such as electrical noise.
Faster (8-16 times faster) and more expensive (8-16 times more
expensive as well) than DRAM.

Dynamic RAM (DRAM)


Each cell stores bit with a capacitor and transistor.
Value must be refreshed every 10-100 ms.
Sensitive to disturbances.
Slower and cheaper than SRAM.

READ ONLY MEMORY

ROM is a non-volatile memory, contents remain unchanged after power is


turned off and on again.

Programs permanently resides in the computer.

The ROM portion of main memory is needed for storing an initial program
called bootstrap loader, witch is to start the computer software operating
when power is turned off

BLOCK DIAGRAM OF RAM CHIP

BLOCK DIAGRAM OF ROM CHIP

MEMORY ADDRESS MAP

Memory Address Map is a pictorial representation of assigned address space for each chip in the
system

Assume that a computer system needs 512 bytes of RAM and 512 bytes of ROM

The RAM have 128 byte and need seven address lines, where the ROM have 512 bytes and need 9
address lines

The memory address map for this configuration is

BLOCK DIAGRAM

CONNECTION OF MEMORY TO CPU

The hexadecimal address assigns a range of hexadecimal equivalent


address for each chip

Line 8 and 9 represent four distinct binary combination to specify which


RAM we chose

When line 10 is 0, CPU selects a RAM. And when its 1, it selects the
ROM

AUXILIARY MEMORY

Devices that provide backup storage

Most commonly used auxiliary devices used in computer systems are


Magnetic disks
Magnetic tapes

Other components used are


Magnetic drums
Magnetic bubble memory
Optic disks

MAGNETIC HARD DISKS

Read-write head
Positioned very close to the platter surface (almost touching it)
Reads or writes magnetically encoded information.
Only one head reads /writes at a time.

Surface of platter divided into circular tracks


Over 16,000 tracks per platter on typical hard disks

Each track is divided into sectors.


A sector is the smallest unit of data that can be read or written.
Sector size typically 512 bytes
Typical sectors per track: 200 (on inner tracks) to 400 (on outer tracks)

To read/write a sector
disk arm swings to position head on right track
platter spins continually; data is read/written as sector passes under

Head-disk

assemblies

multiple disk platters on a single spindle (typically 2 to 4)


one head per platter, mounted on a common arm.
The

arm assembly is moved in or out to position a head on a desired track. Tracks under heads make a
cylinder (imaginary!).

A cylinder

It is the set of tracks at a given radius of a disk pack.


i.e. a cylinder is the set of tracks that can be accessed without moving the disk arm.
All

the information on a cylinder can be accessed without moving the read/write arm.

COMPONENTS OF MAGNETIC
DISK

PERFORMANCE MEASURES OF DISKs

Access time average time required to reach a storage location in memory and obtain its
contents.
Access time = seek time + transfer time

Seek time time required to position the read write head to a location
Average seek time is 1/2 the worst case seek time.

Would be 1/3 if all tracks had the same number of sectors, and we ignore the time to
start and stop arm movement
4 to 10 milliseconds on typical disks

Transfer time time required to transfer data to and from the device.
4 to 8 MB per second is typical
Rotational latency time it takes for the sector to be accessed to appear under the head.
Average latency is 1/2 of the worst case latency.

4 to 11 milliseconds on typical disks (5400 to 15000 r.p.m.)

MAGNETIC TAPE

Magnetic tape is a medium for


magnetic recording generally consisting
of a thin magnetically coating on a long
and narrow strip of plastic. Nearly all
recording tape is of this type, whether
used for recording audio or video or for
computer data storage.
Bits are recorded as magnetic spots on
the tape along the several tracks.
Read/write heads are mounted one in
each track so that data can be recorded
and read as a sequence of characters.

Magnetic
tape units can be
stopped, started to move forward or
in reverse or can be rewound.
Information is recorded in blocks
referred to as records.
Gaps of unrecorded tape are
inserted between records where the
tape can be stopped.
The tape starts moving while in a
gap and attains its constant speed
by the time it reaches the next
record.

ASSOCIATIVE MEMORY

Content Addressable Memory is a


special kind of memory!

Read operation in traditional memory:


Input is address location of the

content that we are interested in it.


Output is the content of that address.

In CAM it is the reverse:


Input is associated with something
stored in the memory.
Output

is location where
associated content is stored.

the

BLOCK DIAGRAM

Compare each word in CAM in parallel


with the Content of A (Argument
Register)

If CAM Word[i] = A, M(i) = 1

Read sequentially accessing CAM for


CAM Word(i) for M(i) = 1

K(Key Register) provides a mask for


choosing a particular field or key in the
argument in A (only those bits in the
argument that have 1s in their
corresponding position of K are
compared)

Argument register
(A)
Key register (K)

input
read
write

Associative
memory array
& logic
M words
N bits per
word

output

EXAMPLE

Suppose that the argument register A and the key register K have the bit
configuration shown below. Only the three leftmost bits of A are compared
with memory words because K has 1s in these positions.
A
101 111100
K
111 000000
Word 1 100 111100
Word 2 101 000001

no match
match

ASSOCIATIVE MEMORY OF m WORD AND n


CELLS PER WORD

MATCH LOGIC FOR 1 WORD

Neglecting key bits,


If Aj=Fij
Word i= argument in A for j=1,2,3n
The equality of two bits can be expressed logically by the boolean function
xj=AjFij + AjFij
Where xj=1 if the pair of bits in position j are equal; otherwise x j=0.
Mi=x1 x2 x3 ..xn
If Kj=0, Aj and Fij need no comparison
Kj=1, Aj and Fij need comparison
This requirement is achieved by ORing each term with Kj

The match logic for each word I in an associative memory can be expressed
by boolean function as.

Substitute the original definition of


expressed as

xj, the boolean function can be

You might also like