Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1-For an 8-way set associative cache that uses 32-bit address and has 16 blocks

ID: 3817841 • Letter: 1

Question

1-For an 8-way set associative cache that uses 32-bit address and has 16 blocks and 32 bytes per block, how big is the cache in bytes?

2- For an 8-way set associative cache that uses 32-bit address and has 16 blocks and 32 bytes per block, how many bits are used for the tag?

3-For an 8-way set associative cache that uses 32-bit address and has 16 blocks and 32 bytes per block, how many bits are used for the set (index)?

4-For an 8-way set associative cache that uses 32-bit address and has 16 blocks and 32 bytes per block, how many bits are used for the byte offset?

Explanation / Answer

Solution :-

We have given 8-way set associative cache that uses 32-bit address and has 16 blocks and 32 bytes per block.

(1) This cache has 16 blocks and 32 bytes per block. So the cache size is 16 x 32 = 512 Bytes.

So this is a 512 Bytes memory cache.

Now we find the tag, Set (index), and offset. below given is address bits of the cash.

In this cash each block size is 32 Bytes so there are 8 word per block, to find each word we need offset of 5 bits. So offset is 5 bits long from bit 0 to 4.

we have 16 blocks so to find a single block it needs 4 bits. So set (index) is 4 bits long from bit 5 to 8.

Now we see that remaining bits from bit 9 to 31 are used for data, so bit 9 to 31 is tag size. So tag size is 23 bits.

SO from above explanation we can find the following-

(2) Bit 9 to 31 is tag size. So tag size is 23 bits.

(3) There are 16 blocks so to find a single block it needs 4 bits. So set (index) is 4 bits long from bit 5 to 8.

(4) Each block size is 32 Bytes so there are 8 word per block, to find each word we need offset of 5 bits. So offset is 5 bits long from bit 0 to 4.

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0