Jump to content

Cycles per instruction

- - - - -

  • Please log in to reply
6 replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
How do I know which machine is faster ?

Machine A:
Fclk = 2.4Ghz; CPI = 2.5

Machine B:
Fclk = 1.8Ghz; CPI = 2.0

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
You want to know how many instructions per second each CPU can perform. To get this, divide the Cycles per Second (the speed) by the Cycles per Instruction. The Cycle terms cancel out, yielding Instructions per Second. The CPU with the larger value will be faster.
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
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
This should help understand the problem:

Posted Image
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


#4
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts

gregwarner said:

This should help understand the problem:

Posted Image

OK. Thank you, I find A is 6.67% more faster that B

#5
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
In this problem:
Consider the execution of a program P with 7.5x10^9 instructions on a machine operating at 5GHz and with a CPI of 0.8. What is the runtime?

My solution:
Tcpu = (7.5x10^9 x 0.8)/(5x10^9) = 1.2s
It's correct ?

#6
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Yes, you're correct.
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


#7
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts

gregwarner said:

Yes, you're correct.

Thank you




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users