0
$\begingroup$

I'm trying to calculate the main memory size, and the only information given is the size of the cache, which is 256 KB, and the number of tag bits, which is 8. Cache is a 4-way set associative memory.

I'm wondering why block size information is missing in this question, because without it, I'm not able to calculate the number of blocks, number of sets, block offset, etc., which will eventually help me calculate the size of main memory.

Is there any way that I could find the block size with the given information above? I'm thinking that the cache size and number of tag bits do give something important, but I'm stuck. Any help will be appreciated.

$\endgroup$

1 Answer 1

0
$\begingroup$

I'm not able to calculate the number of blocks, number of sets, block offset, etc., which will eventually help me calculate the size of main memory.

None of that is required.

Your cache size is $256KB$, which means it can store sequence of $\log_2(2^8.2^{10}) = 18$ bits (assuming it is byte addressable). You will need $\log_2 4 = 2$ of these bits to access a particular block in the $4$-way set. Hence, set number and block offset together take $16$ bits and as mentioned in your question, tag takes $8$ bits; which makes the total address space consist of $24$ bits.

Therefore, main memory size is $2^{8+16}B = 2^{24}B = 16MB$.

$\endgroup$

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.