- #1
Rahulr2k
- 3
- 0
What is set associated mapping and What are the difference between direct and set associated mapping
Direct mapping and set associated mapping are two commonly used methods for mapping data from a cache to main memory.
The main difference between direct mapping and set associated mapping is the way they handle conflicts. In direct mapping, each block of main memory can only be mapped to one specific block in the cache, while in set associated mapping, each block of main memory can be mapped to multiple blocks in the cache.
This depends on the specific system and its needs. In general, direct mapping is simpler and faster, but it can lead to more conflicts and lower hit rates. Set associated mapping, on the other hand, is more complex and slower, but it can reduce conflicts and improve hit rates.
Direct mapping can lead to more conflicts and lower hit rates, which can negatively impact cache performance. Set associated mapping can reduce conflicts and improve hit rates, leading to better cache performance.
Modern systems often use a combination of both direct mapping and set associated mapping, known as n-way set associative mapping. This allows for a balance between simplicity and efficiency, resulting in better overall performance.