There is a 64 KB 1-word cache, and a word is 32 bits. From that I can derive that the length of the tag field is 16 bits, the length of index field is 14 bits, and, as my professor taught me, there is always 2 bits left behind for a byte offset.

Why the offset field is 2 bits, other than it fills in the remaining 2 bits of the word, and what its contents is was never covered in the course.

But when I looked around on Google, I read, and correct me if I am wrong, that the length of the offset field can vary. Although I have found answers on how to determine the length, I could not find anything about determining its contents when a read hit/miss is performed. My professor merely said "the byte offset is not used to select the word in the cache".

Just looking for clarification.

  • 1
    $\begingroup$ I think you may need to provide more background and context and details before this question can be reasonably answered. $\endgroup$ – D.W. Dec 3 '13 at 8:02
  • $\begingroup$ The byte offset is used to address the specific byte(s) within the chunk accessed, the chunk size is often one word. With a 4-byte access chunk, 2 bits are needed to index a specific byte. (Typically, a cache block is larger than one access chunk, so there will also be a block offset that indexes the specific chunk within a cache block. E.g., for a 128-byte cache block and 8-byte accesses the block offset would be 4 bits and the byte offset 3 bits.) $\endgroup$ – Paul A. Clayton Dec 3 '13 at 14:59

Paul A. Clayton gives the answer in a comment.

You say a word has 32 bits. An implicit assumption is that we want to be able access every of the four bytes, so we need two bits to make this distinction.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.