CPIHow many cycles are required for a program to run? Could we assume that N cycles will perform N instructions? No, we couldn't because In general
Now for some computer abbreviations and jargon that you need to understand and know: CPI (Cycle per Instruction)
Instruction Count (Ic) is the number of machine instructions executed. CPIiis the number of cycles required for instruction type i Ii is the number of executed instructions of type i Now, this equation looks daunting... but it isn't so bad when you know what it means. (CPIi x Ii) gives you the total number of cycles for one type of instruction as you have multiplied the number of that instruction type by the average time to carry out that instruction type. However as different instructions take different numbers of cycles to perform them... and you do not have an equal number of each type of instruction, you need to add up that value for each type. That is where the 'sigma' term comes in! The sigma term uses the Greek capital letter for 'S' to denote 'sum of'. It means you have to sum all of the terms in the bracket (CPIi x Ii) taking i from value 1 to n. In other words: (CPIi x Ii) = (CPI1 x I1) + (CPI2 x I2) .......... + (CPIn-1 x In-1) + (CPIn x In) After summing them all you have to divide your sum total by Ic - the instruction count, the number of instructions carried out (of all types). That will then give you a more accurate picture of the average number of cycles for an instruction. What is the real time for a program to run?
T = Ic x CPI x Another method for calculating CPI
Example: From the data below calculate
Average CPI = (1 x 0.6) + (2 x 0.18) + (4 x 0.12) + (8 x 0.1) = 2.24 MIPS rate = instruction count/(CPU execution time x 106)= Ic/(T x 106) MIPS rate = (400 x 106) / (2.24 x 106) ≈ 178 (round down) MIPS rate is useful for comparing performance between similar processors but machines with different instruction sets and programs with different instruction mixes cannot be easily differentiated between by using it. MFLOPS is useful for comparing performance if the processor has to perform a lot of computations with floating-point numbers. |
|