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$

2 Answers 2

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$
0
$\begingroup$

Actually, the logical address space size is at most 16 MB.

The number of tag bits is an essential part of the hardware. If you had 8MB, only 7 tag bits would be needed, but you would have eight to make it possible to increase the memory size.

And your processor most likely has virtual memory, and therefore most likely a logical address space that is substantially larger than RAM. You need enough tags for your logical address space, not the much smaller RAM.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.