#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · STEP BY STEP

CPU Performance Calculator: CPI, MIPS and Execution Time

Enter an instruction mix and clock to get CPI, CPU time and MIPS.

  • 📊 Weighted average CPI
  • ⏱️ CPU time and MIPS
  • ⚖️ Compare two machines

How to use the CPU Performance (CPI, MIPS, Execution Time) Calculator

  1. 1. Enter the mixOne instruction class per line: name, count (or percent) and CPI.
  2. 2. Enter the clockGive the clock rate in GHz or MHz, or the cycle time in ns or ps.
  3. 3. Compare if neededAdd machine B's clock and CPI to see which is faster and by how much.

The CPU performance equation

CPU time = instruction count × CPI × clock cycle time = instruction count × CPI ÷ clock rate.

With several instruction classes, average CPI = Σ(counti × CPIi) ÷ Σ counti. MIPS = instruction count ÷ (CPU time × 106) = clock rate ÷ (CPI × 106). Performance is 1 ÷ CPU time, so "A is n times faster than B" means timeB ÷ timeA = n.

Worked example (Patterson–Hennessy)

Classes A, B, C have CPI 1, 2 and 3. Code sequence 1 uses 2, 1 and 2 instructions of each class; sequence 2 uses 4, 1 and 1.

  • Sequence 1: 2×1 + 1×2 + 2×3 = 10 cycles for 5 instructions, CPI = 2.0.
  • Sequence 2: 4×1 + 1×2 + 1×3 = 9 cycles for 6 instructions, CPI = 1.5.

Sequence 2 runs more instructions but is faster. Another example: machine A has a 250 ps cycle and CPI 2.0; B has 500 ps and CPI 1.2. Time A = I × 2.0 × 250 = 500I ps, time B = I × 1.2 × 500 = 600I ps, so A is 1.2 times faster.

Why MIPS can mislead

MIPS ignores how much work each instruction does. A machine with simple instructions may show higher MIPS but need more of them. Always compare CPU time for the same program.

Frequently asked questions

What is CPI?

Clock cycles per instruction: the average number of clock cycles an instruction takes. Lower is better for the same clock and instruction count.

Can I enter percentages instead of counts?

Yes. Choose % of instructions, enter each class's share and the total instruction count.

How do I convert a cycle time to a clock rate?

Clock rate = 1 ÷ cycle time. A 250 ps cycle is 4 GHz; a 2 ns cycle is 500 MHz.

More free tools

See all free tools