MOD 5 - Memory and Storage Organization
MOD 5 - Memory and Storage Organization
FUNDAMENTALS OF
INFORMATION
TECHNOLOGY
MOD 5 - Memory and Storage
Organization
Learning Objectives
• What is Memory?
• Memory Organization
• Memory Speed
• Classes of Memory
• Main Memory Design
• Cache Memory
• Direct mapping
• Cache mapping
• Set associative mapping
George Jessel
What is Memory?
• Memory is the electronic holding place for the instructions and data
a computer needs to reach quickly.
• It's where information is stored for immediate use.
• Computer memory stores information, such as data and programs, for
immediate use in the computer.
• The term memory is often synonymous with the terms RAM, main
memory, or primary storage.
• Archaic synonyms for main memory include core and store.
Cache
Internal
primary memory
RAM ROM
10
A9-A0
1K x 4 4
WE RAM chip D3-D0
CS
• Memory band-switching
log2 n 1-of-n
Processor Decoder n
1 2 Enable n
Enable 2
Addr bus Enable 1
Memory bank
(On bus in parallel )
Main memory design
• cache hit:
• requested memory resides in cache
Cache
• cache miss:
• requested memory not in cache, and must be fetched from main
memory and put into cache
• unified cache:
• instns, data share same cache
• split cache:
• separate instn, data caches
• parallel access:
• double the bandwidth
• level 2 cache:
• between instn/data cache and main memory
• Cache maintenance algorithms similar in spirit to virtual
memory ideas at operating system level; main difference is
that cache is hardware-supported, whereas v.m. is software
implemented
Measuring cache
performance
• c - cache access time
• m - main memory access time
• hr - hit ratio ( 0 <= hr <= 1) :
• # cache hits / total memory requests
• mr - miss ratio (1-hr)
• mean access time = c + (1-hr)m
• example:
let c = 160 ns
m = 960 ns
h = .90 (common)
efficiency = c / mean
= 160/256 = 62.5%
Direct mapping
Main memory
0
1
Cache
0
i mod N i
N-1
M-1
• Direct mapping places each memory block into a specific cache line within a set, allowing no
alternative placements.
• Direct mapping is a procedure used to assign each memory block in the main memory to a particular
line in the cache.
Cache Mapping
• Cache mapping refers to the technique used to determine how data is
stored and retrieved in cache memory.
• It establishes the mapping between memory addresses and cache
locations.
Set N/S - 1
M-1
Set associative mapping
Set associative mapping
• [4.39]
• write through:
• (ii) whenever modifying data, always write it back to main memory
• have to do this if memory being shared in a DMA or multiprocessing system
Example: direct mapping
4 byte blocks
1 byte words
8 slots in cache
Example − Consider a cache with = 512 lines, then a line would need 9
bits to be uniquely identified.
• Direct mapping divides an address into three parts: t tag bits, l line bits,
and w word bits.
• The word bits are the least significant bits that identify the specific word
within a block of memory.
Example (cont)
The
End