0
\$\begingroup\$

I have a direct mapped cache of size S with the line size L. The cache is physically indexed and tagged. The physical address is 50 bits, numbered from 0 to 49 (with 0 being the least significant bit). The machine has a word size of 4 bits and the memory is byte-addressable. Which bits of the 50 bits are compared with the address tag?

\$\endgroup\$
2
\$\begingroup\$

In a direct-mapped cache, each location in memory has exactly one place in which it can be stored in the cache. So, assuming S is given in bytes, this means that the lower log2S bits of the address are used to locate the data in the cache. The rest of the address bits become the tag.

\$\endgroup\$

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.