Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Suppose a CPU contains 1000 memory references... Start Learning for Free
Suppose a CPU contains 1000 memory references there are 40 misses in L1 cache (First Level Cache) and 20 misses in the L2 cache (Second Level Cache). Assume miss penalty from the L2 cache to memory is 100 clock cycles the hit time of L2 cache is 10 clock cycles, the hit time of L1 cache is 1 clock cycle and "there are 1.5 memory references per instruction.
Q. What is average memory stalls per instruction?
  • a)
    3.4 clock cycles
  • b)
    3.5 clock cycles
  • c)
    3.6 clock cycles
  • d)
    4.5 clock cycles
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Suppose a CPU contains 1000 memory references there are 40 misses in L...
Average Memory Stall per instruction
= Misses Per instruction L1 x Hit time L2 + Misses per instruction L2 x Miss penalty L2
View all questions of this test
Most Upvoted Answer
Suppose a CPU contains 1000 memory references there are 40 misses in L...
The hit time of CPU registers is 0 clock cycles.

To calculate the average memory access time, we need to consider the hit rate of each level of cache.

The hit rate of L1 cache can be calculated as (total memory references - L1 cache misses) / total memory references:
L1 cache hit rate = (1000 - 40) / 1000 = 0.96

The hit rate of L2 cache can be calculated as (L1 cache hits - L2 cache misses) / L1 cache hits:
L2 cache hit rate = (1000 - 40 - 20) / (1000 - 40) = 0.94

Since the hit time for L1 cache is 1 clock cycle and the hit time for L2 cache is 10 clock cycles, the average access time for L1 cache can be calculated as:
L1 cache access time = L1 cache hit rate * L1 cache hit time = 0.96 * 1 = 0.96 clock cycles

Similarly, the average access time for L2 cache can be calculated as:
L2 cache access time = L2 cache hit rate * L2 cache hit time = 0.94 * 10 = 9.4 clock cycles

The miss penalty from L2 cache to memory is given as 100 clock cycles.

Now, we need to calculate the miss rate for each level of cache.

The miss rate for L1 cache can be calculated as L1 cache misses / total memory references:
L1 cache miss rate = 40 / 1000 = 0.04

The miss rate for L2 cache can be calculated as L2 cache misses / L1 cache hits:
L2 cache miss rate = 20 / (1000 - 40) = 0.02

Since the miss penalty from L2 cache to memory is 100 clock cycles, the average access time for memory can be calculated as:
Memory access time = L2 cache miss rate * miss penalty from L2 cache to memory = 0.02 * 100 = 2 clock cycles

Finally, we can calculate the average memory access time as the weighted sum of the access times for each level of cache and memory:
Average memory access time = (L1 cache access time + L2 cache access time + Memory access time) = (0.96 + 9.4 + 2) = 12.36 clock cycles.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer?
Question Description
Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer?.
Solutions for Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Suppose a CPU contains 1000 memory references there are 40 misses in L1cache (First Level Cache) and 20 misses in the L2cache (Second Level Cache). Assume miss penalty from the L2cache to memory is 100 clock cycles the hit time of L2cache is 10 clock cycles, the hit time of L1cache is 1 clock cycle and "there are 1.5 memory references per instruction.Q. What is average memory stalls per instruction?a)3.4 clock cyclesb)3.5 clock cyclesc)3.6 clock cyclesd)4.5 clock cyclesCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev