If a program has 500 arithmetic instructions that take one c

If a program has 500 arithmetic instructions that take one cycle, 300 load/store instructions that take 5 cycles, and 50 branch instructions that take 2 cycles, how long will it take to run on a processor that is 2 GHz?

Solution

Inorder to get the total run time we consider the sum of the products of instructions along with cycles

Run time= [(arthematic instructions* CPI) + (store instructions*CPI) + (load instructions*CPI) + (branch * CPI) ]/clk rate*10^6

=[(500*1+300*5+50*2)]/2*10^6

If a program has 500 arithmetic instructions that take one cycle, 300 load/store instructions that take 5 cycles, and 50 branch instructions that take 2 cycles,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site