edited by
617 views
0 votes
0 votes
Assume that 16 bit cache address memory with cache size 1024 bytes. Block size of cache memory is 8 bytes and tag size is 9 bits. What is the associativity of cache memory?

I am getting 8-way but answer is given as 4.
edited by

2 Answers

3 votes
3 votes
BLOCK SIZE=8 BYTE=3 BIT REQUIRED FOR BLOCK OFFSET

TAG=9 BIT

FROM TOTAL 16 BIT ADDRESS 4 BIT(16-9-3) IS FOR SET OFFSET=> NUM OF SET=S=2^4=16

WE KNOW FOR SET ASSOCITATIVE S=N/K(WHERE N=NUM OF BLOCKS AND K = ASSOCITATIVITY)

SO N=1024/8=128 BLOCKS

=>16=128/K

=>K=8 WAY SET ASSOCITATIVE
0 votes
0 votes

Cache size =  1024 byte i.e. 10 bit to represent 1024
Tag size = 9 bit 
Total Memory size = 16 bit 
let  Associativity is x bit .

Tag + (Cache size i.e. Block size + Number of Cache lines) - Associativity = 16 bit 
9 + (10 - x) = 16 

x = 3 bit 

so  Associativity is 23 = 8 way .

Related questions