556 views
0 votes
0 votes
Consider a direct mapped cache of size 4 lines with line size 4 bytes.if following memory address are requested ,how many

compulsory,conflict and capacity misses are there respectively??

0,4,256,4,268,4,8,0,256,4

1 Answer

1 votes
1 votes

Yes, given are addresses and not memory blocks.

PA size = 10 bits ( highest memory address is 268 for which we need 10 bits to represent) 

#lines = 4 ( 2 bits)

WO = 4 B ( 2 bits )

Tag = PA - ( line + WO) = 10 - ( 2+2) = 6.

       MEMORY ADDRESS        LINE NO     MISS TYPE


0      - 0 0 0 0 0 0 0 0 0 0             0 0              COMPULSORY

4      - 0 0 0 0 0 0 0 1 0 0             0 1              COMPULSORY

256 - 0 1 0 0 0 0 0 0 0 0             0 0              COMPULSORY

4      - 0 0 0 0 0 0 0 1 0 0             0 1               HIT

268 - 0 1 0 0 0 0 1 1 0 0              1 1              COMPULSORY

4      - 0 0 0 0 0 0 0 1 0 0             0 1               HIT

8      - 0 0 0 0 0 0 1 0 0 0             1 0               COMPULSORY

0      - 0 0 0 0 0 0 0 0 0 0             0 0               CONFLICT

256 - 0 1 0 0 0 0 0 0 0 0             0 0               CONFLICT

4      - 0 0 0 0 0 0 0 1 0 0             0 1               HIT


COMPULSORY MISSES:: 5

CONFLICT MISSES        ::  2

CAPACITY MISSES        ::  0

( CAPACITY MISSES HAPPEN ONLY IN CASE OF FULLY ASSOCIATIVE CACHE WHERE CONFLICT MISS CAN NEVER OCCUR) 

Related questions

0 votes
0 votes
0 answers
1
Amit625 asked Dec 28, 2018
416 views
While calculating Effective Address Time, Should we consider sequential access or parallel access by default?
3 votes
3 votes
2 answers
2
Ayan21 asked Sep 11, 2018
992 views
Consider a direct map cache of 8 words, with block 2 words per Block. The following sequence of access to memory block 0,5,2,7,4,0 and 4 is repeated 10 times.Q1) number o...
0 votes
0 votes
0 answers
3
Anuj1995 asked Aug 3, 2018
362 views
Consider a 2-way set associative cache consisting of four one-word blocks. What is the number of misses given the sequence of block addresses 0,8,0,6,8,8,0,6
0 votes
0 votes
0 answers
4
Anuj1995 asked Aug 3, 2018
278 views
What is the probability that a 2-way associative cache with "N" lines will get a hit on an access with a stack distance of 2 (ABCA) ?