1
votes

A 32-bit processor has a two-way associative cache set that uses the 32 address bits as follows: 31-14 tags, 13-5 index, 4-0 offsets.

Calculate :

  1. The size of the cache line in number of words
  2. The total cache size in bits

I do not understand how to solve it, in my slides there is almost nothing on the set associative caches.

Solutions :

  1. 2^3 = 8 words (remaining 3 offset bits removed 2 bits for byte address)
  2. 2 * 2^9 * (1 + 18 + 8 * 2^5)

For 1 Shouldn't it be 2^(number of offset bits) so 2^5? And for 2 what is the formula used?

1

1 Answers

0
votes
  1. The size of a word and the smallest entity addressable are not given. But, if we assume that addresses are byte oriented and that a word hold 4 bytes, there are 2^5 bytes/line and 2^3 words

  2. 2 * 2^9 * (1 + 18 + 8 * 2^5)

2 (number of ways/sets) * 2^9 (number of sets based on index) 
     * (1 (valid bit) + 18 (tag size) + 8 (bits/byte) * 2^5 (line size in bytes))