Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

870 questions

988 answers


439 users

0 votes

according to the solutions to task 2a of exercise sheet 5, the tag size is calculated by

tag size = block address size - set address size

and block adress size = log_2(MemorySize/BlockSize).

How is the set address size calculated? For that task the answer seems to be log_2(4) = 2 but I wonder where that 4 comes from. The only 4 I can find in the exercise is that the processor has a 4-way set-associative cache. Is that how you calculate the set address size?

Thank you very much in advance.
in * TF "Emb. Sys. and Rob." by (1.2k points)

1 Answer

+1 vote
Best answer
In that problem, the 32B cache has 16 blocks (each 2B long). Set associativity tells us the number of blocks in a set, which is 4. Therefore the cache memory has 16/4 = 4 sets. You would need 2 bits to address these 4 sets, which is your set address size. The remaining bits (block address size - set address size) is used as tag.
by (2.5k points)
selected by

Related questions

Imprint | Privacy Policy