[MADEEASY]
Consider a cache as follows :
- Direct Mapped - 16 words total cache size - 4 words cache block size
A sequence of 9 memory reads is performed in order from following addresses
2, 13, 6, 16, 11, 3, 10, 2, 13.
What is maximum number of misses ?
A) 7
B) 4
C) 8
D) 6
----------- MY TRY---------------------------------
(Offset-Last 2 bits & Rest is block and tag)
2 => 000 | 10 - Miss
13 => 011 | 01 - Miss
6 => 001 | 10 - Miss
16 => 100 | 00 - Miss (overwritten first block)
11 => 010 | 11 - Miss
3 => 000 | 11 - Miss (again first is overwritten)
10 => 010 | 10 - Hit (in block 2)
2 => 000 | 10 - Hit (in block 0)
13 => 011 | 01 - Hit (in block 3)
Its giving (D) But answer is given as (C).