Memory Hierarchy: REG Cache Main Secondary
Memory Hierarchy: REG Cache Main Secondary
REG
CACHE
MAIN
SECONDARY
Memory Hierarchy
Registers
In CPU
Primary Memory
May include one or more levels of cache
RAM
Secondary memory
Magnetic/Optical
CACHE:
MAIN MEMORY
-High density ( DRAMs)
-Low cost
-Slower than Cache.
RAM
Static RAM
Fig. 13.60 A differential sense amplifier connected to the bit lines of a particular column. This arrangement can be used directly for
SRAMs (which can utilize both B and B lines). DRAMs can be turned into differential circuits by using the dummy cell arrangement
shown in Fig. 13.61.
Cache
Small amount of fast memory
Sits between normal main memory and
CPU
Mapping Function
Cache of 64kByte
Cache block of 4 bytes
i.e. cache is 16k (214) lines of 4 bytes
Direct Mapping
Each block of main memory maps to only one
cache line
i.e. if a block is in cache, it must be in one specific
place
Direct Mapping
Address Structure
Tag s-r
8
Line or Slot r
Word w
14
24 bit address
2 bit word identifier (4 byte block)
22 bit block identifier
8 bit tag (=22-14)
14 bit slot or line
No two blocks in the same line have the same Tag field
Check contents of cache by finding line and checking Tag
Associative Mapping
A main memory block can load into any
line of cache
Memory address is interpreted as tag and
word
Tag uniquely identifies block of memory
Every lines tag is examined for a match
Cache searching gets expensive
Associative Mapping
Address Structure
Tag 22 bit
Word
2 bit
Set 13 bit
Word
2 bit