114k views
1 vote
Suppose you have the following instruction mix. What is the CPI (Cycles Per Instruction)? Round your answer to 2 decimal places.

Instruction Type:
Memory: 20% frequency, 2 cycles
ALU: 50% frequency, 1 cycle
Branch: 25% frequency, 2 cycles
Jump: 5% frequency, 1 cycle
a)1.25
b)1.50
c)1.75
d)2.00

User Phanto
by
8.9k points

1 Answer

1 vote

Final answer:

To calculate the CPI (Cycles Per Instruction) with the given mix of instruction types and their frequencies and cycles, we sum the products of each type's frequency and cycle count, which gives us a CPI of 1.45, rounded to two decimals as 1.50.

Step-by-step explanation:

To calculate the CPI (Cycles Per Instruction), you must take into account the frequency and cycle count of each instruction type. The formula for calculating the average CPI given an instruction mix is:

CPI = ∑ (Frequency of Instruction Type × Cycles per Instruction)

Using the frequencies and cycles given for each instruction type, we can calculate the CPI as follows:

Adding these up gives a total CPI of:

0.40 + 0.50 + 0.50 + 0.05 = 1.45

Once we round to two decimal places, we get a CPI of 1.45.

Therefore, the correct answer is that the CPI is closest to option b) 1.50.

User Sergei Wallace
by
8.7k points