Jump to content

Problem CPI

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
A machine M1 performs with frequency f1 = 2GHz in 10s. What is the frequency of another machine, M2, to run the same program, with 90% cycles of M1 and 25% higher performance of M1

Any tips on how to find the frequency of M2 ?

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
If M1 operates at 2×10^9 cycles per second (in other words: 2GHz), and it executes the program in 10 seconds, that means the program was executed in 20×10^9 cycles. M2 executes the same program with 90% of the cycles, so:

20×10^9 × 0.90 = x cycles (I'll let you do the math here.) :)

We also know that M2 executes the program with 25% higher performance than M1, which means it takes 25% less time. So:

10 seconds - 25% = y seconds

Lastly, you know how many cycles M2 executed, and you know how many seconds it did it in, so the frequency is simply:

cycles / seconds
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts

gregwarner said:

If M1 operates at 2×10^9 cycles per second (in other words: 2GHz), and it executes the program in 10 seconds, that means the program was executed in 20×10^9 cycles. M2 executes the same program with 90% of the cycles, so:

20×10^9 × 0.90 = x cycles (I'll let you do the math here.) :)

We also know that M2 executes the program with 25% higher performance than M1, which means it takes 25% less time. So:

10 seconds - 25% = y seconds

Lastly, you know how many cycles M2 executed, and you know how many seconds it did it in, so the frequency is simply:

cycles / seconds

M2 execute in 7,75 seconds and f2 = 2,4GHz ?

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Roughly correct. I actually got 2.32 GHz, so I would've rounded down.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users