58.1k views
0 votes
A system has a 256 byte large cache. It is a set-associative cache with 16 sets. An address is 16 bits and the offset field is 3 bits

Specify the number of blocks in the cache

1 Answer

4 votes

Final answer:

The cache has 32 blocks, calculated by dividing the total cache size of 256 bytes by the block size of 8 bytes (2^3, based on a 3-bit offset).

Step-by-step explanation:

The question is asking about a set-associative cache in a computer system and requires one to calculate the number of blocks in this cache.

Given that the system has a cache size of 256 bytes and 16 sets, and that each address has a 3-bit offset field.

The size of each block can be calculated by using the formula 2 to the power of the number of offset bits,

which is 2^3 = 8 bytes per block.

Therefore, the total number of blocks in the cache is the cache size divided by the block size, which in this case is 256 bytes / 8 bytes per block = 32 blocks in the cache.

User Scar
by
8.4k points