# CPI vs MIPS

This page on CPI vs MIPS describes difference between CPI and MIPS.

## CPI

CPI stands for clock cycles per instruction. As we know a program is composed of number of instructions. Instructions can be ALU, load, store, branch and so on. In the computer terminology, it is easy to count the number of instructions executed as compare to counting number of CPU cycles to run the program. Hence average number of clock cycles per instruction has been used as alternate measurement of the performance.

The following is the CPI equation.

CPI = CPU clock cycles for the program/ instruction count

In other words,
CPU time = Instruction count X CPI /Clock rate

If the CPI for each instruction is noted than overall CPI can be calculated as follows:
CPI = Σ CPIi X Ii / Instruction count ,
Where,
Ii = Execution of Number of times an instruction of type i
CPIi = Average number of cycles to execute instruction of type i

## MIPS

MIPS stands for Million Instructions Per Second. It is another measure of performance. It is also referred as rate of instruction execution per unit time.

MIPS can be expressed as per following equation.

MIPS = (Instruction count)/(Execution time X 106 ) = (clock rate/CPI X 106)

MIPS for machines having different instructions sets will have different results. This is because MIPS donot track the execution time.