50.0k views
0 votes
A computer program has three types of instructions. 40% instructions of the program are load instructions, 30% instructions of the program are arithmetic operations, and the rest of the instructions floating point instructions. Each load instruction takes 5 clock cycles to execute. Each arithmetic operation takes 10 clock cycle to execute. And Each floating point instructions takes 12 clock cycle to execute. Calculate the value of Clock Per Instruction (CPI).

User Charanor
by
4.0k points

1 Answer

9 votes

Answer:

8.6

Step-by-step explanation:

total instructions = 100

for load:

total load instructions = 40

time to execute load = 40x5 = 200 clock

for arithmetic:

total arithmetic instructions = 30

time needed to execute = 30x10 = 300 clock

for floating:

total floating instructions = 30

time to execute = 30x12 = 360 clock

when we sum up total clock:

200+360+300 = 860

clock per instruction (cpi) = 860/100

= 8.6

thank you!

User Codyogden
by
4.0k points