edited by
588 views
1 votes
1 votes
[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).
edited by

Please log in or register to answer this question.

Related questions

3 votes
3 votes
1 answer
2
ashish pal asked Dec 31, 2017
1,850 views
The statement " Direct mapped cache, may produce more misses if programs refers to memory words that occupy a same tag value." is true or false ?