The main memory of a computer has blocks while the cache has blocks. If the cache uses the set associative mapping scheme with blocks per set, then block of the main memory maps to the set:
View worked solution
Answer: B
In a set-associative cache mapping scheme, a main memory block maps to a cache set index calculated as:
where is the total number of sets in the cache.
From the given problem details:
- The total number of blocks in the cache is .
- The cache is -way set-associative (i.e., there are blocks per set).
We can calculate the total number of sets in the cache as:
Substituting into the mapping formula, main memory block maps to the set:
Hence, the correct option is B.
Free practice · Your answers on this page are not saved.
