retagged by
782 views
0 votes
0 votes
, if the sequence of blocks refered by cpu is given as 1,3,5,6,7,1,5,4.
retagged by

1 Answer

Best answer
1 votes
1 votes
LIFO policy is the property of stack. If we want to replace any block, then we have to remove the block which is referred last.

The cache is 4-blocked & initially empty. So first 4 blocks are all different. No hits. All misses.

Total Hits = 0, Total Misses = 4

(Referred first) 1 3 5 6(last referred)

Next block is 7. It is a miss. So now we should replace 6 with 7.

Total Hits = 0, Total Misses = 5

(Referred first) 1 3 5 7(last referred)

Next 2 blocks are already present in the cache. So no need for replacement.

Total Hits = 2, Total Misses = 5

Last block is 4. Its a miss. So we can replace 7 with 4.

Total Hits = 2, Total Misses = 6

(Referred first) 1 3 5 4(last referred)
selected by

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
4
Anjan asked Dec 24, 2017
906 views
Consider a cache as follows:Direct mapped8 words total cache data size2 words block sizeA sequence of memory read is performed in the order shown from the following addr...