Search code examples
cpuclockequationprocessorhyperthreading

how many instructions can it execute in one second?


  • A processor has 4 cores
  • Each core has 2 - Hyper threads
  • Its clock frequency is 2 GHz
  • On average, an instruction needs 4 cpu cycles to execute on each hyperthread

How many instructions can it execute in one second? I need help as to which equations to use. I know that 1 GHz has 1 cpu cycle at 1 nano second so therefore the 2 GHz will do one cpu cycle in .5 nano seconds.


Solution

  • Well, I'll get you started, but it's a basic math problem.

    2Ghz - frequency, in [cycles/second]. 4 - instruction duration, in [cycles/ops].

    So 2Ghz [cycles/second] / 4 [cycles/ops] = 0.5Ghz [ops/second]. Note that the cycles unit cancels out and this "feels right" because we're left with the units that are being asked for :)

    Do similar math to account for the Hyper-threads and Cores - only it will be multiplication. (You can carry through the units, e.g. [ops*threads*cores/second], but they can be dropped in context of the answer which is asking for ops/second across all v-cores.)