The CPU execution time of a program is given by one equation:
time = instructions × CPI × clock period
or, the same thing, instructions × CPI ÷ frequency.
Read it in two parts: instructions × CPI is the total number of clock cycles; multiplying by the clock period turns cycles into seconds.
So there are exactly three ways to make a program faster:
- execute fewer instructions (a better algorithm or a richer instruction set);
- need fewer cycles per instruction (better control or more parallel hardware);
- use a shorter clock period (faster circuits or more pipelining).
They often trade against each other. A single cycle processor has CPI = 1 but a long period; a multi cycle processor has a short period but CPI > 1. Only the full product says which wins.
Write units next to every number. Most slips are a lost factor of 1000 between ns, µs and ms.