Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A cache address has three fields: Offset bit length: 6 bits Index bit length: 5

ID: 3573293 • Letter: A

Question

A cache address has three fields:
Offset bit length: 6 bits Index bit length: 5 bits Tag bit length: 11 bits
Identify the cache block size, overall cache size, and main memory size for: -direct map configuration -2 way associative cache configuration - 4-way associative cache configuration 6. A cache address has three fields: Offset bit-length: 6 bits Index bit-length: 6 bits Tag bit-length: 11 bits Identify the cache block size, overall cache size, and main memory size for direct map, 2-way associative cache and 4-way associative cache configurations (30 pts)

Explanation / Answer

Total bits in physical address = 11+5+6= 22

So Main Memory Size = 2^(total bits) = 2^22= 4 MB

Block size = Line size = 2^(offset bits) = 2^6 = 64 Bytes

Lines in Cache = 2^(index bits) = 2^5 = 32 lines

So cache size = lines * block size = 2^5 * 2^6 = 2^11 = 2KB

Whether it is direct mapping or 2-way associative mapping or 4-way associative mapping , block size , cache size and main memory size will be same.

Only difference will be the way main memory blocks are mapped to cache lines. In direct mapping every 2^5 th block will be mapped to same cache line. So total 2^11 blocks will be mapped to each line.In set associative sets will be made by inclusion of some lines. For eg in 2-way set associative , every set will have 2 lines and in 4-way , every set will have 4 lines. And in one set block can be mapped anywhere.