Formula and meaning
IC counts instructions actually executed; CPI is their effective average. Clock frequency f has units Hz = 1/s.[1][2]
Instruction count is not source-code line count. Loops, compilers and instruction sets affect it. Big-O notation instead describes asymptotic growth and does not by itself give execution time in seconds.[1][2]
CPI may be fractional and below one when multiple instructions complete per cycle. Use the effective average for this workload. I/O waits, network latency and waiting for an available processor core are not automatically included in this CPU time.[1][2]
Why the formula holds
First add cycles across all executed instructions. For classes with counts ICi and class values CPIi, C = Σ ICi·CPIi. Dividing by total instruction count gives weighted CPI. Classes are weighted by executed instructions rather than treated equally.[1][2]
Average memory access time can help explain stall cycles. Do not simply add it to CPU time when the measured CPI already includes those stalls, because that would count the same effect twice.[1][2]
Units, inverses and limits
These inverses are unique for IC > 0 and T > 0. The calculator does not infer a rounded instruction count from a measurement.[1][2]
1 GHz means 109 cycles per second, not 109 instructions per second. Doubling frequency halves model time only if instruction count and effective CPI remain unchanged. Power limits, cache effects and throttling may violate that assumption in practice.[1][2]
Two fully worked examples
A program run at 3 GHz
- Given
- IC = 600,000,000, CPI = 1.5 and f = 3 GHz.
- Find
- Find CPU time.
Calculate cycles from count and average.
Convert gigahertz to hertz and divide.
Result: T = 0.3 s = 300 ms of CPU time.
Check: 3·109 cycles/s · 0.3 s recovers the required 9·108 cycles.
Weighting two instruction classes
- Given
- 80 million instructions at CPI 1 and 20 million at CPI 4; f = 2 GHz.
- Find
- Find effective CPI and time.
Weight the slower class by its actual instruction count.
Divide total cycles by clock frequency.
Result: CPI = 1.6 and T = 80 ms.
Check: The direct sum of 80 + 80 = 160 million cycles agrees with IC·CPI. The unweighted mean 2.5 would be wrong.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Higher frequency under fixed assumptions
Five exercises with solutions
Calculate · Foundation
120 million instructions have CPI = 2 at 2.4 GHz. Find CPU time.
Show hint
Find cycles first, then seconds.
Learning goal: Combine instruction count and frequency.
Rearrange · Application
200 million instructions run in 0.12 s at 2.5 GHz. Find CPI.
Show hint
Use CPI = Tf/IC.
Learning goal: Infer average CPI from measurements.
Interpret · Application
What changes when only IC is halved?
Show hint
Hold CPI and f fixed.
Learning goal: Separate model comparisons from practical changes.
Error analysis · Application
Someone enters f = 3 for 3 GHz and obtains 300 million seconds. What is wrong?
Show hint
The denominator uses 1/s as its base unit.
Learning goal: Check metric prefixes.
Transfer · Challenge
Version A uses 100 million instructions at CPI 2. Version B uses 140 million at CPI 1.2. Both run at 2 GHz. Which is faster?
Show hint
Compare IC·CPI products.
Learning goal: Compare compiler changes across multiple factors.
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Sources for this explanation
Quanta · Updated November 9, 2026
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Complete DE/EN learning article with explicit model limits, calculator, original graphic and solved exercises.
Cite this reference page
Quanta. CPU time from instructions, CPI and clock rate. Updated November 9, 2026. https://quanta-study.de/en/formula-sheet/cpu-laufzeit-instruktionen-cpi-takt
When citing a specific scientific statement, also cite the specialist source linked to that statement.