Problem Detail: Suppose that the processor reads cache memory in one clock cycle.In case of cache miss the processor needs 5 clock cycles to read the information in the main memory.What should be the value of Cache hit rate so that AMAT=2? We know that AMAT=Hit time+ (Hit rate)*(Miss penalty) Hit rate= (AMAT-Hit time)/Miss penalty= (2-1)/6=1/6 I am not sure if miss penalty is 6.I know that miss penalty is the sum of the time taken to read the cache memory and the time needed to read the information from the main memory.Which means that Miss penalty=5 +1=6 .Still something feels off here.
Asked By : cindar
Answered By : Ran G.
Two things are clear from the statement of the quesiton: The hit access time is 1 cycle, while the miss access time is 5 cycles. But you are not sure if the “miss penalty” is just a different name for the “miss access time”, or is it in fact the “miss access time” minus the “hit time”, right? So let’s think about this together. What is this AMAT thingy you are trying to compute? it is the Avarage access time. (i’d guess AMAT stands for Avarage Memory Access Time, right?). Let’s assume the miss-rate is 1/6. It means that 5/6 of the times, we have a hit, but 1/6 of the times it’s a miss. In this case the average access time would be: $$ frac56 times 1 + frac16 times 5 = 1 frac23$$ BUT OH NO! that’s not what you got. Note that your formula for AMAT is not
AMAT = (hit-rate)*hit-time + (miss-rate)(miss-time)
but it is (fixing the typo you have there, miss-rate${}=(1-{}$hit-rate$)$)
AMAT = hit-time + (miss-rate)(miss penalty)
But AMAT is just AMAT, which can mean only one thing: for hit you pay “hit-time”, and for miss you pay “hit-time + miss-penalty”. Again: you always pay the hit, and only if it is a miss, you pay an extra of the miss-penalty. Make sure you see that this is exactly what your AMAT formula says. Therefore, the miss-penalty must be defined as the miss-access-time minus the hit-access-time.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/43281