Compare the hit ratio for a cache memory implemented using three different mapping procedures:
- Associative mapping
- Direct mapping
- Set associative mapping
We aim to calculate the hit ratio for three different mapping procedures. The same set of data is used for all three procedures. Cache memory (implemented using three different arrays) is linearly scanned (using appropriate techniques as mentioned above) to find the number of hits and misses for the set of seven addresses.
Theoretically, the hit ratios of associative, direct and set associative mapping is in the following order: Associative > Set associative > Direct mapping