1. Mapping Functions
A mapping function is the method used to locate a memory address
within a cache
It is used when copying a block from main memory to the cache and it is
used again when trying to retrieve data from the cache
•Cache mapping defines how a block from the main memory is
mapped to the cache memory in case of a cache miss.
2. Cache Example
These notes use an example of a cache to illustrate each of the mapping
functions. The characteristics of the cache used are:
• Size: 64 kByte
• Block size: 4 bytes – i.e. the cache has 16k (214) lines of 4 bytes
• Address bus: 24-bit– i.e., 16M bytes main memory divided into 4M 4 byte blocks
• Main memory is divided into equal size partitions called
as blocks or frames.
• Cache memory is divided into partitions having same size as that of
blocks called as lines.
• During cache mapping, block of main memory is simply copied to the
cache and the block is not actually brought from the main memory.
4. Cache Mapping Techniques-
• The memory system has to quickly determine if a given address is in
the cache
• There are three popular methods of mapping addresses to cache
locations4
–Fully Associative – Search the entire cache for an address
– Direct – Each address has a specific place in the cache
–Set Associative – Each address can be in any of a small set of cache
locations