Okay.I have problem about cache mapping. Here is the problem .

Memory size is 1 MB
Byte addresable
Cache block size is 16 Bytes.
Cache size is 64kb

Since memory is 1 mb=2**20 Bytes.

So we need 20 bits for the one single address .

Since it is byte addressable and each block size is 16 bytes we need for 4 bits the offset

and for the index 64 KB/16 bytes is equal to 2 to the power 12

so we need 12 bits for the index

So remain part goes to the tag and which is 20-(12+4) = 4 bits.

After that I have given address which is 32 bit long in hexadecimal. For example

My question is how to find the tag,index and offset from the above address?

| cite | improve this question | | | | |
  • $\begingroup$ Under normal circumstances we would convert the hexadecimal number to binary and then pick out the tag, index and offset. If your physical memory address is 20 bit long, how are you going to have a 32 bit address in the first place? $\endgroup$ – Sagnik Jul 12 '18 at 11:11
  • $\begingroup$ Thanks for the comment.I had the same idea.But the question was given as above $\endgroup$ – Kalana Mihiranga Jul 12 '18 at 11:20
  • $\begingroup$ If the question is not from a standard source then it's pointless to waste time on trivial mistakes. $\endgroup$ – Sagnik Jul 12 '18 at 11:23
  • $\begingroup$ It was question from a university paper.I thought that question is wrong.But cant say it surely $\endgroup$ – Kalana Mihiranga Jul 12 '18 at 12:54
  • $\begingroup$ Anyone have idea whether the question is correct or not? $\endgroup$ – Kalana Mihiranga Jul 13 '18 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.