Reputation:
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.
Upvotes: 4
Views: 8132
Reputation: 9124
This question is a bit incomplete. Just because, on average an instruction takes 4 cycles doesn't mean that a processor cannot work on more than one thing at a time. Instruction level parallelism (ILP) is had by employing concepts like super-scalar execution, pipelining and out-of-order execution mean that we have processors are capable of completing 4 instructions (or more) on every cycle. So the numbers you need are the processor frequency, the number of cores, and the number of instructions per second (IPC) that each core can sustain. Things like hyperthreading, caching, prefetching, etc. are just features that help the processor reach the IPC that it was designed for. Check out computer architecture books like Hennesy & Patterson's Computer Architecture: A Quantitative Approach. Generally ILP is covered in one of the first couple of chapters.
Upvotes: 1
Reputation: 61875
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.)
Upvotes: 2