188k views
0 votes
Assume that you have an ISA with the following instructions and required CPI for two different processors. Insturction Processor A Processor B ld 1 1 sd 3 4 add 1 2 sub 3 2 mul 7 5 div 7 11 Suppose that you have a program with 40,000,000 instructions where 20% are ld, 10% are sd, 30% are add, 10% are sub, 20% are mul, and 10% are div. Calculate the following: a) The CPI for both Processor A and Processor B for this program.

1 Answer

2 votes

Final answer:

To calculate the CPI for both Processor A and Processor B, multiply the instruction count for each instruction type by the CPI for that instruction, and sum the results. Then, divide the sum by the total instruction count

Step-by-step explanation:

To calculate the CPI for both Processor A and Processor B, you need to multiply the instruction count for each instruction type by the CPI for that instruction, and sum the results. Then, divide the sum by the total instruction count. For Processor A, the CPI would be [(1 * 1) + (3 * 3) + (1 * 1) + (3 * 3) + (7 * 7) + (7 * 7)] / 40,000,000 = 0.49825. For Processor B, the CPI would be [(1 * 1) + (4 * 3) + (2 * 1) + (2 * 3) + (5 * 7) + (11 * 7)] / 40,000,000 = 0.54175.

User Demwis
by
7.9k points