recategorized by
418 views

1 Answer

1 votes
1 votes

 

 

 

For $4$ way associative memory (Assuming memory is Byte addressible): 

Size of a block $=$ No. of words in a block x Size of a word $= 8$ x $32$ bits = $32$ bytes

So size of the OFFSET field is $5$ bits.

No. of blocks in the cache $=$$\frac{Size\space of\space the\space cache}{Size\space of\space a\space block}$$=$$\frac{16 KB}{32 B} = 512$

No. of sets $= \frac{No.\space of\space blocks}{Associativity} = \frac{512}{4} = 128$

So the no. of bits in the INDEX field $= 7$.

Physical address size $= 32\space bits$. 

So the number of bits in the TAG field $= 32 -(5+7) = 20$.

Now For 16 way associative memory using same given values for block size, word size and cache capacity,

OFFSET field $= 5$ (same)

No. of blocks in the cache $= 512$ (same)

No. of sets $= \frac{No.\space of\space blocks}{Associativity} = \frac{512}{16} = 32$

So, the no. of bits in the INDEX field $= 5$

No. of bits in the TAG field $= 32-(5+5) = 22$.

 

 

 

 

Related questions

1 votes
1 votes
0 answers
3
1 votes
1 votes
1 answer
4
Asim Abbas asked Jan 22, 2018
313 views
The answer was given as 22 bits. I didn't get their method of solving this question. Kindly explain the solution. I even doubt their answer.