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

Consider two machines one with and one without division hardware. Consider a pro

ID: 3843733 • Letter: C

Question

Consider two machines one with and one without division hardware. Consider a program which involves 40% of the computations to be division, 20% multiplication and 40% the rest. Machine 1 with division hardware can perform division quite fast. The number of cycles for each class of instruction is: Division (8 cycles), multiply (6 cycles) and rest (4 cycles). Machine 2 has no division hardware and thus division has to be implemented (by repeated subtraction) using software macros and thus requires 32 cycles. Both machines are operational at 500MHz. Find the MIPS ratings for each of the machines.

Explanation / Answer

Machine 1 :-

         Given 40% of the computations to be division

                  20% of the computations to be multiplication and

                  40% for rest of the computations.

         Given Machine operates at a frequency of 500MHz

   Hence the clock period of the Machine is = 1 / 500MHz

   = 1 / 500 * 106

   = 0.2 * 10-8 = 2 * 10-9

   Hence the clock period of the Machine is = 2 ns = 1 cycle time.     

   Total Number of cycles for Instruction execution is = 40 % * 8 + 20% * 6 + 40% * 4

= 3.2 + 1.2 + 1.6

= 6

   Hence Total Number of cycles for Instruction execution is = 6.      

          Instruction execution time is = Total Number of cycles * cycle time

                                                    = 6 * 2ns = 12ns

          Hence Instruction execution time is = 12ns

          MIPS Rating = Number of Instructions / (time to execute * 1 million)

                             = 1 / (12ns * 106)

                             = 1 / (12 * 10-3)

                             = 1000 / 12 = 83.3

          Hence MIPS Rating for Machine 1 is = 83.3
                         

Machine 2:-

         Given it takes a total of 32 cycles to execute the instruction

         Given Machine operates at a frequency of 500MHz

   Hence the clock period of the Machine is = 1 / 500MHz

   = 1 / 500 * 106

   = 0.2 * 10-8 = 2 * 10-9

   Hence the clock period of the Machine is = 2 ns = 1 cycle time.     

   Total Number of cycles for Instruction execution is = 32       

          Instruction execution time is = Total Number of cycles * cycle time

                                                    = 32 * 2ns = 64ns

          Hence Instruction execution time is = 64ns

          MIPS Rating = Number of Instructions / (time to execute * 1 million)

                             = 1 / (64ns * 106)

                             = 1 / (64 * 10-3)

                             = 1000 / 64 = 15.625

          Hence MIPS Rating for Machine 2 is = 15.625