1

I am having a hard time understanding clock cycles. Here is the problem, I am given a program that has two instructions X and Y and I know that X is run 20% of the time and requires 8 clock cycles and the other instruction Y is run 80% of the time and requires 2 clock cycles. If my program has 10 million instructions I need to find:

A. The minimum number of clock cycles to execute one instruction?

B. The maximum speed up using Amdahl's Law that can be found by improving instruction X.

This is my huntch and please help me where I am wrong. For A the minimum number of clock cycles to execute one instruction is 1 clock cycle. I thought I read this somewhere but I am not sure.

To do B I am assuming that I was to solve for the speedup when X has a clock cycle of 1 because that would mean it is executing the fastest.

Are theses assumptions correct? Any help would be appreciated. Thanks

Tim Post
  • 33,371
  • 15
  • 110
  • 174

1 Answers1

0

I don't know about 1

But for 2 the program takes T = .2*10 000 000*8 + .8*10 000 000*2 cycles
Improving instruction X could make it take only n cycles (answer from 1)
Which means U = .2*10 000 000*n + .8*10 000 000*2 cycles to run the program
This means it will take U/T time of the original to run the program if you make the improvement. A speed increase by a factor of T/U

Jean-Bernard Pellerin
  • 12,556
  • 10
  • 57
  • 79
  • thank you for the response. This is how I understood the question also but the second question states that there is a specific numerical answer to the question so to solve I need to know what it means to achieve maximum speed and I assume that means either increasing or decreasing clock cycles, but again i am not sure. Thanks though for the answer. – bangkockFighter Jun 06 '11 at 23:12
  • @bangkockFighter It would be achieved by decreasing the clock cycles required for instruction X, and the answer is T/U – Jean-Bernard Pellerin Jun 06 '11 at 23:14