Calculate CPU time from instruction count, cycles per instruction and clock speed, or find the clock rate needed or a processor’s instruction throughput.
Related Calculators
- Bits per Second to Hertz Calculator
- Cycles to Seconds Calculator
- Clock Cycles Per Instruction Calculator
- Floating Point Operations Per Second Calculator
- MIPS Calculator
- All Unit Converters
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| CPU execution time | Finds how long a processor takes to run a given number of instructions | Requires the instruction count, the average cycles per instruction and the clock rate |
| Instruction throughput | Finds how many instructions per second a set of identical cores completes | Requires the clock rate, the measured instructions per cycle, the number of active cores and their average utilization |
| Required clock rate | Finds the clock rate needed to finish a workload within a target time | Requires the instruction count, the average cycles per instruction and the target CPU time |
Clock rates are entered in GHz or MHz and instruction counts in single instructions, millions or billions. The execution time and throughput functions accept a comparison clock rate and cycles per instruction, which add a second processor’s figures for the same workload. The throughput function also accepts a parallel fraction, which adds an Amdahl speedup.
Processor Speed Formulas
| T | CPU execution time (s) |
| I | Number of instructions executed |
| CPI | Average clock cycles per instruction |
| f | Clock rate (Hz) |
A program needs I ร CPI clock cycles, and each cycle lasts 1 รท f seconds [1]. Clock rate is therefore only one of three terms. The instruction count depends on the compiler and the instruction set, and the cycles per instruction depend on the instructions used and on the processor design [1].
CPU execution time
One billion instructions at 1.5 cycles per instruction on a 3 GHz processor take 1,000,000,000 ร 1.5 รท 3,000,000,000 = 0.5 s. The result also lists the total clock cycles, the clock period and the effective rate in millions of instructions per second, 2,000 MIPS here.
Instruction throughput
IPC is the measured instructions per cycle, the inverse of CPI, N is the number of identical active cores and U is their average utilization in percent. A 3 GHz processor at 2 instructions per cycle completes 6 billion instructions per second on one busy core. Four cores at 75% utilization complete 3 ร 2 ร 4 ร 0.75 = 18 billion instructions per second, shown as 18 GIPS. This assumes each core does independent work.
1 รท ((1 โ p) + p รท N) [2]
When a parallel fraction p is entered, the result adds this Amdahl speedup for one fixed workload, where p is the share of the single-core run time that can be spread across N cores [2]. With 90% parallel work and four cores it is 1 รท (0.1 + 0.9 รท 4) = 3.08 times, and it can never exceed 1 รท (1 โ p), 10 times here [2]. The speedup is reported separately and is not multiplied into the throughput.
Required clock rate
This is the main formula solved for the clock rate. Running one billion instructions at 1.5 cycles per instruction in 0.25 s needs 1,000,000,000 ร 1.5 รท 0.25 = 6,000,000,000 Hz, or 6 GHz.
Limits of This Estimate
- Clock rate alone is not a measure of performance. Two processors at the same clock rate can differ widely in cycles per instruction, and the same program can compile to different instruction counts.
- Cycles per instruction and instructions per cycle are measured for one workload on one processor. Memory stalls, shared caches and changes in clock rate under load alter them.
- CPU execution time leaves out time spent waiting for input, output or other programs.
- The Amdahl speedup is an upper bound that ignores the overhead of coordinating cores.
Sources
- University of Utah, CS 3810 Computer Organization, Lecture 2: Performance: CPU execution time equation and what sets each of its terms
- Lawrence Livermore National Laboratory, Introduction to Parallel Computing Tutorial: Amdahl’s law and its upper limit
