A program consists of 4 types of instructions as shown below
A program consists of 4 types of instructions as shown below. What is the average CPI? How long does a program take to run on a processor with a 2GHz clock if it has 10^10 instructions and a CPI of 2? A program takes 15 seconds to execute. There are 10^10 instructions with a CPI of 1.5. What is the clock cycle time?
Solution
1) To calculate average CPI the formula is
CPI = (ICi)(CCi)/IC
ICi - no of instruction for given instruction type i
CCi - the clock-cycles for that instruction type
Summation of multiplication of ICi and CCi
CPI = (15*1+25*2+40*3+20*4)/(15+25+40+20)
CPI = (15+50+120+80)/(100)
CPI= 265/100
CPI = 2.65
