edited by
828 views
0 votes
0 votes
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?
edited by

1 Answer

3 votes
3 votes
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 by

Related questions

1 votes
1 votes
0 answers
2
1 votes
1 votes
1 answer
4
Asim Abbas asked Jan 22, 2018
310 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.