Answer:
a) 4 ns
b) 3.6 ns
Explanation:
Given that
Miss penalty = 20 * 2
Miss rate = 0.05
Clock cycle = 2 ns
Hit time = 1 * 2
The Average Memory Access Time or AMAT is found by using this formula
AMAT = Hit time + Miss rate × Miss penalty
Substituting directly for the values, we get
AMAT = 2 + [0.05 * (20 * 2 ns)]
AMAT = 2 + (0.05 * 40)
AMAT = 2 + 2
AMAT = 4 ns
b) given that
Miss rate = 0.03
Hit time = 1.2 * 2
Miss penalty remains the same = 40
AMAT = (1.2 * 2) ns + [0.03 * 40] ns
AMAT = 2.4 ns + 1.2 ns
AMAT = 3.6 ns
Considering that the AMAT is 3.6, we can say that it is a good trade-off.
c) CPU time = Clock cycle * IC * (CPIideal-cache + cache stall cycles per instruction)
CPU time
(a) = 2 ns * IC * (2 + 1.5 * 20 * 0.05) =
CPU time = 2 * IC * (2 + 1.5)
CPU time = 2 * IC * 3.5
CPU time = 7 * IC
(b)
CPU time = 2.4 ns * IC * (2 + 1.5 * 20 * 0.03)
CPU time = 2.4 * IC * (2 + 0.9)
CPU time = 2.4 * IC * 2.9
CPU time = 6.96 * IC
The CPU times we calculated in parts (a) and (b) are nearly the same. Thus, we can conclude that, doubling the cache size to improve the miss rate at the expense of stretching the clock cycle results in virtually no net gain.