I am trying to answer this question:

Consider a computer with a byte-addressable memory. A 40-bit memory address is divided as follows for cache processing. First, the 8 low-order bits are chopped off to expose the cache-line number. Second, the next 17 low-order bits are inspected to get the cache-container index. Third, the remaining 15 bits are used as the cache tag. Hint: What do the direct-mapped and set-associative placement formulas have in common?

What is the cache size in bytes?

I've figured out that the cache line size is 2^8 bytes and that there are thus 2^32 cache lines in memory. Furthermore I know that there are 2^17 cache sets in the cache. To compute the capacity of the cache, I am using the equation

capacity = line size x #of sets x associativity

However, even using the tag field, I can't see how I can find the associativity of the cache here.


1 Answer 1


I'm not sure if the first question is actually a question or a Hint. Anyway cache size can be calculated as follows.

Memory is byte addressable. Masking off 8 bits for cache line, that means, cache line in 2 ^ 8 bytes. Using 17 bits for TAG indexing, that is 2^17 cache entries. Therefore, you have 2^8*2^17 bytes in the cache. That is 2^25 = 2^5*2^20 = 32 MB.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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