Memory Part-Ii
Memory Part-Ii
Memory Part-Ii
Cache Main
CPU
Memory Memory
Holds those parts of the program Holds those parts of the program
and data that are not presently and data that are most heavily
used by the CPU. used by the CPU.
CPU does not have directly access CPU has the directly access to
to auxiliary memory. cache memory.
• The CPU
communicates with
both memories.
• It first sends a 15-bit
address to cache.
• If there is a hit, the
CPU accepts the 12-bit
For Main Memory data from cache.
Size = 32K words of 12 bits each • If there is a miss, the
32K = 32 x 1024 words = 215 CPU reads the word
Size of Address Bus = 15 bits from main memory
Size of Data Bus = 12 bits and the word is then
For Cache Memory transferred to cache.
Size = 512 words of 12 bits each
I Associative Mapping
• The fastest and most
flexible cache organization
uses an associative
memory.
• The associative memory
stores both the address and
content (data) of the
memory word.
• This permits any location
Fig. 3 Associative mapping cache (all in cache to store any word
numbers in octal). from main memory.
I Associative Mapping
• A CPU address of 15 bits is placed
in the argument register and the
associative memory is searched
for a matching address.
• If the address is found:
12-bit data is read and sent to
the CPU
• If the address is not found:
the main memory is accessed,
• If the cache is full, a and
room is made for a pair the address data pair is then
• First in First Out (FIFO) transferred to the associative
replacement policy. cache memory
Associative Mapping…
Advantages
Flexibility
Any main memory word can be loaded to the cache
anywhere.
Fastest cache organization
Limitation
Associative memory are expensive because the added
logic associated with each cell.
II Direct Mapping
Fig. 4 Addressing relationships
between main and cache memories
• CPU address of 15-
bit tag field
and index field.
• The number of bits
in the index field =
no. of address bits
required to access
the cache memory.