629 views
0 votes
0 votes
An address sequence S experiences 100 compulsory cache misses. The sequence S experiences 500 misses when it is passed through a 32 KB fully-associative cache. The sequence S experiences 1000 misses when it is passed through a 32 KB 8-way set-associative cache. The number of conflict misses that the sequence S experiences when it is passed through a 32 KB 8-way set-associative cache is _________

2 Answers

3 votes
3 votes

Compulsory misses occurs when a block of main memory is trying to occupy fresh empty line of cache.
Conflict misses are those misses which occur due to memory locations being mapped to same cache line.

For example: 

Suppose you have a 16 KB cache and you have an array of size 32 KB, which you have to access twice. Now, there is no way, that an array can fit into cache. So there are going to be misses in both accesses. Few accesses will result compulsory misses, which are unavoidable, and would occur even if cache has infinite capacity.

Suppose you have a 16 KB cache and you have an two arrays of size 8KB each which you have to access twice. So, theoretically, both can fit into cache simultaneously. So theoretically, there would not be any misses on second access. But if the cache arrangement is such that both 8KB chucks are mapped to same area of cache, then there would be misses in second access too.

From the question:

  • We are given there are 100 compulsory misses happening. So, if we assume cache to be very large, then there are 100 unique elements whose access would result in 100 compulsory misses.
  • Fully associative cache means any block of main memory can be placed on any cache line. When we use this cache, we are given that 500 misses occur. Out of these, above 100 are compulsory misses. So, in all 400 conflict misses occur. These must be occurring because, something from the cache is to be removed to accommodate something else from memory.
  • 8-way set associate cache means, there are sets of 8 lines in each set. When we use such a cache, we are given that 1000 misses occur. Out of these, above 100 are compulsory misses. So in all, 900 conflict misses occur.
2 votes
2 votes
The misses generated when we move from a fully associative cache to direct mapped is called conflict miss. i.e., in a set associative cache with full set size we have 0 conflict miss and as the number of sets increases the misses generated due to conflicts are called conflict misses. So, the number of conflict misses here will be $500.$

Related questions

0 votes
0 votes
1 answer
1
Hakuna Matata asked May 23, 2018
1,156 views
What was the last rank in the waitlist group which got admission offer from IIT Kanpur last year?Is there any chance for waitlist rank of around 20?
1 votes
1 votes
1 answer
2
Hakuna Matata asked May 6, 2018
330 views
Are the admissions based solely on written & programming tests, or does GATE score get some weightage during final selection?