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

Assume that a computer is running with a 4 GHz clock. Instruction Fetch takes 3

ID: 3652111 • Letter: A

Question

Assume that a computer is running with a 4 GHz clock. Instruction Fetch takes 3 cycles. If operands are in cache (cache hit), Fetch Operands takes 3 cycles. If they are not in the cache (cache miss), it takes 7 cycles. Execute takes 10 cycles. How many cycles does it take to run a program of 2000 instructions? Assume that Decode and Store Output time is negligible. 90% of fetch operations result in cache hits while the other 10% result in cache misses. On the average, how much time in microseconds does it take to run the program of 2000 instructions?

Explanation / Answer

Let us divide the problem into two modules

1. Cache hit

2. Cache Miss

In, Cache hit, time taken for instruction cycle is

Instruction fetch (3)+ fetch operand(3) + Execute(10) = 16 cycles.

In, Cache miss, time taken for instruction cycle is

Instruction fetch (3)+ fetch operand(7) + Execute(10) = 20 cycles.

Now, let's find number of cache hit instructions and number of cache miss instructions

Number of cache hit instructions= 90% of 2000=1800

Number of cache miss instructions= 10% of 2000=200

Cycles taken for Cache Hit Instructions= 1800 X 16 =28,800 cycles

Cycles taken for Cache Hit Instructions= 200 X 20 =4,000 cycles

Total No of Cycles= 28,800 + 4,000=32,800

Given, frequency is 4GHz that means

4 x 109 cycles happen in 1 second

32,800 cycles happen in 32,800/4 x 109 seconds = 8.2 x 10-6 seconds = 8.2 micro seconds.

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