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

9. (20 pts). We are studying two implementations of a machine, one with and one

ID: 3748501 • Letter: 9

Question

9. (20 pts). We are studying two implementations of a machine, one with and one without special floating-point hardware. Consider a program P with the following mix of operations Floating-point multiply Floating-point add Floating-point divide Integer instructions 10% 15% 5% 70% Machine MFP (Machine with Floating-point) has floating-point hardware and can therefore implement the floating-point operations di for each instruction class: rect ly. It requires the following number of clock cycles Floating point Multiply Floating point Add Floating point Divide Integer instructions 6 cycles 4 cycles 20 cycles 2 cycles Machine MNFP (Machine with No Floating Point) has no floating-point hardware and so must emulate the floating-point operations using integer instructions. Each integer instruction on MNFP takes 2 clock cycles (so its CPI is 2). The number of integer instructions needed to implement each of the floating-point operations on MNFP is as follows:

Explanation / Answer

Answer :

Convert the MNEP data into no. of cycles

Floating point multiply,

            30 x 2 = 60 cycles

            20 x 2 = 40 cycles

            50 x 2 = 100 cycles

Using weighted AM method, find an average CPI for machine MFP and MNFP

Average CPI for MFP = (0.10 * 6) + (0.15 * 4) + (0.05 * 20) + (0.70 * 2) = 3.6 CPI

Average CPI for MNFP = (0.10 * 30) + (0.15 * 20) + (0.05 * 50) + (0.70 * 2) = 9.9 CPI

Clock rate = 100 MHZ

MIPS ratings for both machines

MIPS ratings for MFP = 100 / 3.6 = 27.77 MIPS

MIPS ratings for MNFP = 100 / 9.9 = 10.1 MIPS

b) For MNFP,

Number of instructions = 300 million

Number of integer instructions required for 300 million instructions = 300 x 9.9

= 2970 million.

c) CPU time for MFP and MNFP

CPU time for MFP = Number of instructions / MIPS = 300 / 27.77 = 10.8 sec.

CPU time for MNFP = Number of instructions / MIPS = 300 / 10.1 = 29.70 sec.