0
\$\begingroup\$

I've a difficulty understanding what is asked by this questions:

enter image description here

Can you explain in more detail? AFAIK the associativity determines the number of sets and the size of the set determines the number of bits that is not the tag. Is that correct? Then the block size determines the number of bytes per row of each set.

Here we got block size 4 words i.e. 4*4 bytes = 16 bytes. Which is 2^4 so there are 4 bytes per row of each set. Since there is only one set, the size of the set is 16 KB = 2^4 * 2^10 * 2^2 = 2^16 = 16 KB data. But I don't understand the third sentence "Each block has 4 X 32 or 128 bits of data plus a tag." Why is the number of bits an other than the size of the data?

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

The question does indeed make some implications which may not be too obvious.

I would infer:

  • 16KB = 4K words ==> 1 word = 4 bytes = 32 bit.
  • 1 block = 4 words ==> 1 block = 4 * 4 bytes = 128 bit
    • Verify: 16KB / ((4*4 bytes)/block) = 1024 blocks -- check.

For each block(/line) of the cache there is some "administrative" data needed for the logic to know "what's cached where". This is the "tag". In the given example it is already calculated that for each block (128 bits) of data there will be (32-10-2-2)+1 = 19 bits needed for this administrative information, which means there is an overhead of (19/128) ~ 15% of extra storage required.

\$\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.