49 views
The cache can hold 64 KB .data is transferred between main memory and cache in blocks of 4 bytes each.the main memory consist of 16 M Bytes . if the cache memory is 16-way set associative,Then the hexa decimal main memory address AAAAAA is mapped into which cache set?
0
682 ?
0
ya it is 682

The cache memory size is 64KB i.e 2^16Bytes.Block size =4bytes

No of lines in cache=2^16/2^2=2^14

The cache is 16 way set associative. So the no of sets is : size of cache/size of sets=2^14/16=2^(14-4)=2^10.

So whenever a particular main memory cell has to be mapped to cache it would be mapped to the set for %2^10. that means that for cache block no we need the last 10 bits of the main memory address.

for main memory : address is of 22 bits and 2 bits are for block offset

So the address given to us is AAAAAA . In Binary it is 1010 1010 1010 1010 1010 1010..

2 bits are for the block offset So address is :

1010 1010 1010 1010 1010 10.

As we require last 10 bits for the purpose of mapping we get :10 1010 1010 i.e=682.

Correct me if I am wrong..
edited
0
Yaa its right . Thnx for the explanation

+1 vote
1
2