How can I calculate the number of cache lines per set or the cache size with the given information?

  • m (number of physical address bits): 32
  • C (cache size): unknown
  • B (Block size in bytes): 32
  • E (number of lines per set): unknown
  • S (number of cache sets): 32
  • t (tag bits): 22
  • s (set index bits): 5
  • b (block offset bits): 5
  • associativity unknown

Since we can calculate C with C=B*E*S or E with E=C/(B*S). I just need to know how to calculate C or E.


1 Answer 1


You can calculate it with the help of tag, index, and offset bits. Read about it here.

  • $\begingroup$ I think it's not possible. Assume E=32=C/B (fully associative cache) then C is 2^15. Assume E=1 (direct mapped cache) then C is 2^10. Please show me how you would calculate it. $\endgroup$ Jan 29, 2019 at 15:28

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.