Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem #5 (a) A computer has separate instruction and data caches. The data cac

ID: 3731463 • Letter: P

Question

Problem #5
(a) A computer has separate instruction and data caches. The data cache has a hit rate of 95% and
the instruction cache has a hit rate of 98%. Assume that 25% of instructions are loads and
stores. If a processor has a CPI of 1.5 without any memory stalls and the miss penalty is 100
cycles for all misses, determine how much faster a processor would run with a perfect cache
that never missed.
(b) A system has level-1 cache and level-2 cache. The hit rate for level-1 cache is 90% and the hit
rate of level-2 cache is 80%. An access to level-1 cache requires one cycle, an access to level-2
cache requires four cycles, and an access to main memory requires 50 cycles. What is the
average memory access time?

Explanation / Answer

Answer to (a):

75% instructions are non load store which does not access data cache.

Out of theses instructions 2% needed miss penalty.

So total cycles needed for such a non load store instruction = 0.98x1.5 + 0.02x100 = 1.47+2 = 3.47

25% instructions are load store instructions which access data cache.

Out of theses instructions 5% needed miss penalty.

So total cycles needed for such a load store instruction = 0.95x1.5 + 0.05x100 = 1.425+5 = 6.425

So average cycles needed per instruction = 0.75x3.47 + 0.25x6.425 = 2.6025 + 1.60625 = 4.20875

Therefore speedup = 4.20875 / 1.5 = 2.8

So the processor will run 2.8 times faster.

Answer to (b):

If the data is available in level-2 cache then it requires 4 cycles otherwise it requires 50 cycles.

The hit ratio of level-2 cache=80%

So cycles needed to accessing through level-2 cache = 0.8x4 + 0.2x50 = 3.2 +10 = 13.2

If the data is available in level-1 cache then it requires 1 cycles otherwise it requires 13.2 cycles.

The hit ratio of level-2 cache=90%

So cycles needed to accessing through level-1 cache = 0.9x1 + 0.1x13.2 = 0.9 + 1.32 = 2.22

Average memory access time = the time needed for 2.22 cycles.

NB: Hope it helps to get your answer. Let me know any concern.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote