You are on page 1of 35

CIT 2143

Computer
Organization
+

Chapter 3

Memory

Location
Internal (e.g. processor registers, cache,
main memory)
External (e.g. optical disks, magnetic disks,
tapes)
Capacity
Number of words
Number of bytes
Unit of Transfer
Word
Block
Access Method
Sequential
Direct
Random
Associative

Performance
Access time
Cycle time
Transfer rate
Physical Type
Semiconductor
Magnetic
Optical
Magneto-optical
Physical Characteristics
Volatile/nonvolatile
Erasable/nonerasable
Organization
Memory modules

Key Characteristics of Computer Memory Systems

Characteristics of Memory
Systems

Location

Capacity

Refers to whether memory is internal and external to the computer


Internal memory is often equated with main memory
Processor requires its own local memory, in the form of registers
Cache is another form of internal memory
External memory consists of peripheral storage devices that are
accessible to the processor via I/O controllers

Memory is typically expressed in terms of bytes (1byte = 8 bits)

Unit of transfer

For internal memory the unit of transfer is equal to the number of


electrical lines into and out of the memory module

Method of Accessing Units of Data


Sequential
access

Direct
access

Random
access

Associative

Memory is organized into


units of data called
records

Involves a shared readwrite mechanism

Each addressable
location in memory has a
unique, physically wiredin addressing mechanism

A word is retrieved
based on a portion of its
contents rather than its
address

Access must be made in


a specific linear
sequence

Individual blocks or
records have a unique
address based on
physical location

The time to access a


given location is
independent of the
sequence of prior
accesses and is constant

Each location has its own


addressing mechanism
and retrieval time is
constant independent of
location or prior access
patterns

Access time is variable

Any location can be


selected at random and
directly addressed and
accessed

Cache memories may


employ associative
access

Access time is variable

Main memory and some


cache systems are
random access

Capacity and Performance:


The two most important characteristics of
memory
Three performance parameters are used:
Access time (latency)
For random-access memory it is the
time it takes to perform a read or
write operation
For non-random-access memory it
is the time it takes to position the
read-write mechanism at the
desired location

Memory cycle time


Access time plus any additional
time required before second
access can commence
Additional time may be required
for transients to die out on signal
lines or to regenerate data if they
are read destructively
Concerned with the system bus,
not the processor

Transfer rate
The rate at which data can be
transferred into or out of a memory
unit
For random-access memory it is
equal to 1/(cycle time)

+ Memory

The most common forms are:

Several physical characteristics of data storage are important:

Semiconductor memory
Magnetic surface memory
Optical
Magneto-optical

Volatile memory
Information decays naturally or is lost when electrical power is switched off
Nonvolatile memory
Once recorded, information remains without deterioration until deliberately changed
No electrical power is needed to retain information
Magnetic-surface memories
Are nonvolatile
Semiconductor memory
May be either volatile or nonvolatile
Nonerasable memory
Cannot be altered, except by destroying the storage unit
Semiconductor memory of this type is known as read-only memory (ROM)

For random-access memory the organization is a key design issue

Organization refers to the physical arrangement of bits to form words

Memory Hierarchy

Design constraints on a computers memory can be summed


up by three questions:

How much, how fast, how expensive

There is a trade-off among capacity, access time, and cost

Faster access time, greater cost per bit

Greater capacity, smaller cost per bit

Greater capacity, slower access time

The way out of the memory dilemma is not to rely on a single


memory component or technology, but to employ a memory
hierarchy

Inb
me oard
mo
ry

Ou
t
sto boar
rag d
e

Of
f
sto -line
rag
e

gRe r s
e
i st
Ca

e
ch
in
Ma ory
m
me

isk
cd
i
t
e
gn OM
M a D- R W
C D -R W
R
C
D - AM
V
D D- R y
a
DV lu-R
B

Ma

gn

ct
eti

ap

Memory

The use of three levels exploits the fact that semiconductor


memory comes in a variety of types which differ in speed
and cost

Data are stored more permanently on external mass storage


devices

External, nonvolatile memory is also referred to as


secondary memory or auxiliary memory

Disk cache

A portion of main memory can be used as a buffer to hold data


temporarily that is to be read out to disk
A few large transfers of data can be used instead of many small
transfers of data
Data can be retrieved rapidly from the software cache rather than
slowly from the disk

Block Transfer
Word Transfer

Main Memory

Cache

CPU
Fast

Slow

(a) Single cache

Level 2
(L2) cache

Level 1
(L1) cache

CPU
Fastest

Fast

Level 3
(L3) cache
Less
fast

(b) Three-level cache organization

Figure 4.3 Cache and Main Memory

Main
Memory
Slow

Line
Number Tag
0
1
2

Block

Memory
address
0
1
2
3

Block 0
(K words)

C1
Block Length
(K Words)

(a) Cache

Block M 1
2n 1
Word
Length

(b) Main memory

Figure 4.4 Cache/Main-Memory Structure

Address

Processor

Control

Cache

Control

Data
buffer

Data

Figure 4.6 Typical Cache Organization

System Bus

Address
buffer

Cache Addresses
Virtual Memory

Virtual memory

Facility that allows programs to address memory from a logical


point of view, without regard to the amount of main memory
physically available

When used, the address fields of machine instructions contain


virtual addresses

For reads to and writes from main memory, a hardware memory


management unit (MMU) translates each virtual address into a
physical address in main memory

Logical address

MMU

Physical address

Processor

Main
memory

Cache
Data

(a) Logical Cache

Logical address

MMU

Physical address

Processor
Cache
Data

(b) Physical Cache

Figure 4.7 Logical and Physical Caches

Main
memory

Mapping Function

Because there are fewer cache lines than main memory


blocks, an algorithm is needed for mapping main memory
blocks into cache lines

Three techniques can be used:


Direct

The simplest technique


Maps each block of main
memory into only one
possible cache line

Associative
Permits each main
memory block to be
loaded into any line of the
cache
The cache control logic
interprets a memory
address simply as a Tag
and a Word field
To determine whether a
block is in the cache, the
cache control logic must
simultaneously examine
every lines Tag for a
match

Set Associative
A compromise that
exhibits the strengths of
both the direct and
associative approaches
while reducing their
disadvantages

b
L0

m lines

B0

Bm1

Lm1

First m blocks of
main memory
(equal to size of cache)

cache memory
b = length of block in bits
t = length of tag in bits

(a) Direct mapping

b
L0

one block of
main memory
Lm1

cache memory
(b) Associative mapping

Figure 4.8 Mapping From Main Memory to Cache:


Direct and Associative

L0
k lines

B0

Cache memory - set 0

Lk1

Bv1
First v blocks of
main memory
(equal to number of sets)

Cache memory - set v1

(a) v associative-mapped caches

B0

L0

v lines

one
set

Bv1

First v blocks of
main memory
(equal to number of sets)

Cache memory - way 1

Cache memory - way k

(b) k direct-mapped caches

Figure 4.13 Mapping From Main Memory to Cache:


k-way Set Associative

Lv1

+
Internal Memory

Flash memory

+
External Memory

Magnetic Tape

Magnetic tapes was used traditionally for large


systems like mainframe computers where large
volume of data is stored for a longer time.
Still used these days for backups (especially off-site backups)

The cost of storing data in tapes is inexpensive, which


makes it attractive for large volume off-site storage.

28

+ Magnetic Disk / Hard Disk Drive


Magnetic disks: A common form of secondary storage on a
magnetized disk divided into tracks and sectors that provide
addresses for various items of data; also called hard disks or
hard drives or hard disk drives (HDD): all modern computers
come equipped with a HDD.
Each disk consists of a number of concentric circles of
microscopic width called tracks. Information is recorded on
tracks of a disk surface in the form of tiny magnetic spots.

The presence of a magnetic spot represents 1 bit and its


absence represents 0 bit. The information stored in a disk can
be read many times without affecting the data stored.

29

Hard Disk Drive


1 = platters
2 = spindle
3 = actuator arms
4 = pivot mechanism
5 = drive head
6 = tracks
7 = sectors
8 = clusters
9 = landing area
10 = interface

30

Magnetic Disks

31

Optical Disks
Optical storage devices: A form of secondary storage in which a
laser reads the surface of a reflective plastic platter.

CD: Compact Disk that uses a laser to read information stored


optically on a plastic disk; data is evenly distributed around track.

CD-ROM read-only memory

CD-WORM write once, read many

CD-RW both read from and written to

DVD: Digital Versatile Disk; similar to CD but can store more


data used for storing audio and video.

Like CD available as read-only, write-once and read/writeable


32

Optical Disks

33

Other Storage Devices


Memory cards: Credit-card-size storage devices that
can be installed in an adapter or slot in many personal
computers or digital camera.

34

Other Storage Devices

External hard disk drives:


Same as for magnetic HDD, but
external to the computer (USB
device)

Flash/thumb/pen drives:
USB device.

35

You might also like