Professional Documents
Culture Documents
Computer Architecture and Organization: Chapter Three
Computer Architecture and Organization: Chapter Three
Computer Architecture and Organization: Chapter Three
Organization
Chapter Three
Lecture 1
Memory System
1
Memory Unit
In this chapter:
Memory Hierarchy
Cache Memory
Main Memory
External Memory
2
Memory Unit
3
Memory
Memory is an essential component of computers
It is used for storing programs and data
It exhibits wide range of
Type
Technology
Organization
Performance, and cost
4
Characteristics of Memory Systems
Location
Capacity
Unit of transfer
Access method
Performance
Physical type
Physical characteristics
Organization
5
Characteristics :- Location
Location:
Refers to whether it is internal or external to computers
CPU:
Registers
Internal:
main memory, cache
Directly accessible by CPU
External: – magnetic disks, tapes, optical disks
Accessible by CPU thru I/O module
6
Characteristics :- Capacity
Capacity:
For internal memory, typically expressed in bytes (8 bits)
or words (8, 16, 32 bits)
External, in terms of bytes
Unit of transfer:
Equal to the number of electrical lines into and out of the
memory module.
For main memory, this is the number of bits read out of or
written into memory at a time.
Internal: the no of data lines into and out of memory
May be equal to word length or larger (64, 128, or 256 bits)
7
Characteristics :- Related
Related concepts
Word: the “natural” unit of organization of memory
Usually equal to size of integer or instruction length
Addressable units: Smallest location which can be
uniquely addressed
Usually a word
Some systems allow memory addressing at byte level
For a length of A address bits, no of addressable units
N is 2A = N
For external memory, transfer is in blocks
8
Characteristics :- Method of Access
Method of access:
A) Sequential access:
Access to records is made in a specific linear sequence
Shared read/write mechanism
Access time :– depends on location of data and current
location of read/write mechanism
e.g. tape
B) Direct access:
Individual blocks have unique address
Shared read/write mechanism
Access by jumping to vicinity plus sequential search
Access time :– depends on location and current location of
read/write mechanism
9
e.g. disk
Characteristics …
C) Random access:
Each addressable location in memory has a unique, physically
wired-in addressing mechanism.
Each location :– its own (wired) addressing mechanism
Access time :– constant, independent of location or previous
access
e.g. RAM
D) Associative
Data is located based on a portion of its content rather than its
address.
Comparison done simultaneously on all words
Access time: – independent of location or previous access
e.g. cache
10
Characteristics :- Performance
Access time (latency)
For random-access memory:- it is the time from the instant
that an address presented to the memory to the time that the
data have been stored or made available for use.
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 a
second access can commence.
Represents (access time + recovery time)
Note: memory cycle time is concerned with the system
bus, not the processor. 11
Characteristics :- Performance
Transfer rate
Rate at which data can be moved into/out of a memory unit
For random-access memory:
Transfer rate= 1 / cycle time
For non-random-access memory:
TN = TA + N/R
TN = average time to read/write N bits
TA = average access time
N = number of bits
R = transfer rate [bps]
12
Characteristics :- Physical Characteristics
Physical Types
Semiconductor: RAM
Magnetic surface: Disk & Tape
Optical and magneto optical: CD & DVD
Issues
Volatile/Non-volatile
Erasable/Non-erasable
13
Memory Hierarchy
Design constraints :– The 3 questions:
How much memory?
Never enough
Larger memory capacity → more complex
applications will be developed to use it
How fast?
Need to keep up with CPU
How expensive?
Reasonable with respect to the other components
Can’t have them all!
14
Memory Hierarchy
Solution:
Memory hierarchy
15
Memory Hierarchy
16
Memory Hierarchy
Registers
L1 Cache
L2 Cache
Main memory
Disk cache
Disk
Optical
Tape Access Cost per Capacity Frequency of
time bit access by
CPU
17
Memory Hierarchy
18
Locality of Reference
20
Cache Memory Principle
21
Cache/Main Memory Structure
22
Cache/Main Memory Structure
Main memory consists up to 2n addressable words, with each word
having a unique n-bit address.
For mapping purposes, let us assume this memory consists of a number
of fixed length blocks of k words each.
M=2n/k (number of blocks in main memory)
The cache consists of m blocks, called lines. Each line contains k-word
plus a tag of a few bits and other control bits.
Note:
The length of a line, not including tag and control bits, is the
line size
Tags: – identify which block of main memory is in each cache line
23
Cache Operation
24
Typical Cache Organization
25
Next:
Elements of cache design
26