retagged by
2,508 views
3 votes
3 votes

Suppose that a direct mapping cache has 29  lines, with 24 bytes per cache line. If cache items of a byte addressable memory space of 229 bytes. How many bits of space will be required for storing tags( do not include bits for validity or other tags; only consider the cost of tags themselves) [in bits].

A. 28        b. 213      C. 211    

 D. none of these

 

 

retagged by

2 Answers

Best answer
9 votes
9 votes
A tag is used to identify which of the memory block is currently present in a cache block. So, here you have to fin the no. of distinct memory block (a block is the size of cache line- 16 bytes in this question) which can be mapped to a given cache line. Say, this is x- now we need $\lg x$ tag bits as we store tag in binary. Now, this tag is needed for each cache line- so multiply by the total no. of cache lines to get the total tag storage needed in bits.

Don't look below until you get an answer.  

Calculations will be as follows:

No. of memory blocks = $\frac{2^{29}}{2^{4}} = 2^{25}$.

No. of memory blocks which can be mapped to a given cache line = Total no. of blocks/No. of cache lines (As direct mapping is used)

$ = \frac{2^{25}}{2^9} = 2^{16}$.

So, we need 16 tag bits for each cache line.

So, total tag storage required $= 2^9 \times 16 = 2^{13} $bits.
3 votes
3 votes
Tag=16 bits line number=9bits 4bits for B-offset

Tag directory =number of cache lines x tag bits=16 x 2^9=2^13 bits

Related questions

2 votes
2 votes
1 answer
2
2 votes
2 votes
2 answers
3
khushtak asked Oct 25, 2015
1,592 views
Let cache of 0.7 hit having average access time 9 times faster than that of memory.  if average access time increases 40% from 80ns. What would be new hit ratio.A. 0.72 ...
0 votes
0 votes
0 answers
4