47.5k views
2 votes
Consider a 4-way set-associative mapped cache of size 16KB with a block size of 8 words. The size of the main memory is:

a. 5,9,3
b. 2,4,11
c. 12,2,3
d. 12,2,4

User Tawnos
by
8.9k points

1 Answer

6 votes

Final answer:

The size of the main memory can be calculated using the formula: Size of Cache = Number of Sets × Associativity × Block Size. Given the cache size is 16KB and it is 4-way set-associative with a block size of 8 words, the size of the main memory is 128.

Step-by-step explanation:

The size of the main memory can be calculated using the formula:

Size of Cache = Number of Sets × Associativity × Block Size

Given that the cache size is 16KB and it is 4-way set-associative with a block size of 8 words, we can substitute the values into the formula:

16KB = Number of Sets × 4 × 8 words

Converting the cache size to words:

16KB = Number of Sets × 4 × 8 × 4 bytes

Now, solving for the number of sets:

Number of Sets = 16KB / (4 × 8 × 4B)

Number of Sets = 16 × 1024B / (4 × 8 × 4B)

Number of Sets = 16 × 1024 / 4 × 8 × 4

Number of Sets = 16 × 1024 / 128

Number of Sets = 128

Therefore, the size of the main memory is 128.