Associative Mapping
Associative Mapping
3. Mapping process
Each block in main memory can be placed in any of the 64 cache lines.
To identify the block in cache, a tag is used.
4. Physical address bits
P.A bits= log2 (MM size )32,768
We know 32,768= 2^15
So, P.A bits 15
Block Offset
Block Offset Bits=log2 (Block Size in Bytes)
log2 (64)= 2^6=6bits
Tag bits
The tag bits helps to identify which block is stored in cache.
To calculate the tag bits use total number of blocks.
Tag bits= 512= 2^9
Tag bits = 9
Accessing Data:
The cache controller searches the tag field of all lines in the cache.If the tag matches, it's a cache hit
and the data is fetched.
If no match is found, it's a cache miss.
Advantages & Disadvantages
Advantages
Eliminates mapping conflicts.
Allows better cache utilization
Disadvantages
Higher cost due to complex hardware
Slower access times due to tag comparison
Conclusion
Associative mapping is an efficient cache mapping technique
It balance flexibility and complexity for better performance.