Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Q3. (a) Assume that multiply instructions take 15 cycles and account for 20% of

ID: 3738614 • Letter: Q

Question

Q3. (a) Assume that multiply instructions take 15 cycles and account for 20% of the instructions in a typical program, and the other 80% of the instructions require an average of 2 cycles for each instruction, what percentage of time does the CPU spend doing multiplication? (b) Your hardware engineering team has indicated that it would be possible to reduce the number of cycles required for multiplication to 8 in (a), but this will require a 20% increase in cycle time. Nothing else will be affected by the change. Should they proceed with the modification?

Explanation / Answer

Q3.

a.)

Let there are 100 instructions in a program .

This impies , among 100 instructions, 20 instructions are of multiply type and the rest are of non-multiply type.

So total time taken by 20 multiply instructions = 20 * 15 cycles = 300 cycles

Total time taken by 80 non-multiply instructions = 80 * 2 cycles = 160 cycles

% of time CPU spend on multiplication = (300/(300+160)) * 100 % = 65.21 %

b.)

Lets try to calculate the number of cycles required after modification.

Total number of modified cycles required for multiplication = 20 * 8 = 160

Total number of modified cycles required for non-multiplication type of instruction = 80 * 2 = 160

Total number of modified cycles required for the whole program = 160+ 160 = 320 modified cycles

Total number of cycles required for the whole program after modification = 320 * 1.2 cycles (because each modified

cycle is equivalent to 1.2 cycle)

= 384 cycles

Previously without modification it requires 300+160 = 460 cycles but after modification it requires only 384 cylces.

So Yes they should proceed with the modification.