Stall cycles refer to the CPU cycles which degrade the performance of the processor. During stalling the CPU is actually not doing any productive work.
So for this question we would first calculate avg stall cycles per 1000 memory references.
Avg Stall Cycles/1000 memory references = (stall cycles if we don’t find the referred memory in L1 cache) + (stall cycles if we don’t find the referred memory in L2 cache)
= (miss rate L1* miss penalty L1) + (miss rate L2* miss penalty L2)
= (150/1000 * 50) + (100/1000 * 120)
=7.5 + 12
Avg Stall cycles per instruction is asked in the question.
So Avg stall cycles/instruction = (Avg stall cycles/1000memory references) * (4 memory references/Instruction)
= 19.5 * 4