134k views
3 votes
You are asked to optimize a cache design for the given references. Th ere are three direct-mapped cache designs possible, all with a total of 8 words of data: C1 has 1-word blocks, C2 has 2-word blocks, and C3 has 4-word blocks. In terms of miss rate, which cache design is the best? If the miss stall time is 25 cycles, and C1 has an access time of 2 cycles, C2 takes 3 cycles, and C3 takes 5 cycles, which is the best cache design?

1 Answer

5 votes

Answer:

Step-by-step explanation:

From the given data, Direct-Mapped cache with 8words of data means 2^3 of data.

There are three caches C1, C2 and C3.

C1 has 1 word blocks

C2 has 2 word blocks

C3 has 4 word blocks

also, Miss stall = 25 cycles.

We have,

Miss rate = 3% for current block size

Thus, for cache C1, miss rate = 3%

cache C2, miss rate = 2%

cache C3, miss rate = 1.2%

So, the cache C3 design is the best. In terms of miss rate. The cache performance increases with decrease in miss penalty.

That means if miss penalty is less, then the performance of cache increases. And for cache C3, the miss penalty is less.

From given data

C1 acess time is 2 Cycles.

C2 acess time is 3 Cycles.

C3 acess time is 5 Cycles.

Then

C1 stall time is 25*11+ 2*12 = 299.

C2 stall time is 25*9+ 3*12 = 261.

C3 stall time is 25*10+ 5*12 = 310.

In this case, C2 is the best cache design.

And

C1 stall time is 25*11+ 2*12 = 299.

C2 stall time is 25*8+ 3*12 = 236.

C3 stall time is 25*8+ 5*12 = 260.

In this case also, C2 is the best cache design.

User SHAKIR SHABBIR
by
6.2k points