edited by
1,815 views
7 votes
7 votes
Consider a physically tagged, word addressable, 16-way set associative cache with the line size of 128 Bytes. What is the size of cache if tag memory size is 2Kbits. Further assume that physical address space is 24 bits and word size is 4 Bytes.

a. 1 KB

b. 2 KB

c. 3 KB

d. 4 KB
edited by

1 Answer

Best answer
4 votes
4 votes
  • 16 - way set Associative 
  • Line size = 128B 
  • Size of tag memory = 2Kbits
  • Physical Address space = 24 bits
  • Word size = 4B

Words in a line = $\large \frac{Line \ size}{ Word \ size} = \frac{128 B}{4 B} = 32 \ words$

Bits needed for indentifying a word from a line = 5 bits

Let number of bits for set = s

Then tag bits = 24 - 5 - s = 19 -s

 

Number of blocks = Number of sets $\times$ number of blocks per set = $2^s \times 16$

Tag memory size = Tag bits  $\times$ Number of blocks

$\Large 2^{11} = \left ( 19-s \right ) \times 2^s \times 16$

$\Large \frac{2^7}{2^s} = 19 - s$

$\Large 2^{7 -s} = 19 - s$

$\large s = 3$

Tag bits = 19 - 3 = 16

Number of blocks = $\frac{Tag \ Memory \ Size}{ Tag \ Size}$ = $\frac{2^{11}}{2^4} = 2^7$

Size of cache = Number of blocks $ \times $ Block size   $= 2^7 \times 2^7   = 2^{14} = 16 KB$

 

edited by

Related questions

0 votes
0 votes
1 answer
3
Tulsidhar M asked Nov 30, 2018
807 views
What is the correct formula for tag directory size in associative mapped cache concept.?