COMP3370A1.docx - COMP 3370 Assignment 1 Jingyi Huang 7787399 performancex = 1 according to the definition of performance a b 1 executionTime x Prefm1 =

COMP3370A1.docx - COMP 3370 Assignment 1 Jingyi Huang...

This preview shows page 1 - 3 out of 7 pages.

COMP 3370 Assignment 1 Jingyi Huang 7787399 1. according to the definition of performance: performance x = 1 executionTime x ; a) Pref m1 = 1/5 ; Pref m2 = 1/30; So, the performance of M 1 is 0.2; the performance of M 2 is 1/30. b) pref m 1 pref m 2 = 1 5 1 30 = 30 5 = 6. So M 1 is 6 times faster than M 2 . 2. 4 minutes = 240 seconds for M 2 a) M 1 is 8 times faster than M 2 , then pref m 1 pref m 2 = 1 n 1 240 = 240 n = 8 , therefore n = 240/8 = 30 sec, so the execution time on M 1 is 30 sec. b) M 3 is 4 times slower than M 2 , then pref m 2 pref m 3 = 1 240 1 n = n 240 = 4 , therefore n = 240*4 = 960 sec, it is 16 minutes. 3. Since seconds program = cycles program seconds cycle , clock rate = 1 seconds cycle = 2.8*10 9 cycles/sec; a) Clock cycles = CPU time / cycle time = CPU time*clock rate = 9*2.8*10 9 = 2.52*10 10 cycles. b) We want to a 1.2 times speed up, then the CPU time became: 9/1.2 = 7.5 sec; then, clock rate = 1 clockcycletime = 1 CPU time clockcycles = clockcycles CPU time = 2.52 × 10 10 7.5 = 3.36 × 10 9 sec . So, the clock rate we need is 3.36 GHz. 4. For M 1 , clock rate = 2*10 9 cycles/sec, clock cycles = 2*10 8 cycles/program. Then, the CPU time
Image of page 1
of M 1 is: CPU time = clockcycles clock rate = 2 × 10 8 2 × 10 9 = 0.2 sec. For M 2 , clock rate = 2.5*10 9 cycles/sec, clock cycles = 2*10 8 *1.3 = 2.6*10 8 cycles/program. Then, the CPU time of M 2 is: CPU time = clockcycles clock rate = 2.6 × 10 8 2.5 × 10 9 = 0.104 sec . a) Since Tm 1 = 0.2 sec, Tm 2 = 0.104 sec, machine M 2 is much faster than machine M 1 . b) Since performance x = 1 executionTime x ; Pref m1 = 1 0.2 ; Pref m2 = 1 0.104 ; then, Pref m 2 Pref m 1 = 1 0.104 1 0.2 = 0.2 0.104 = 1.92 . so, machine M 2 is 1.92 times faster than machine M 1 . 5. CPU time for M 1 is: 10 sec, clock rate = 2*10 9 cycles/sec. Now, for a better implementation, we need CPU time for M 2 is: 4 sec; for the M 1 ’s clock cycles, we know: CPU time = clockcycles clock rate , so clock cycles for M 1 = CPU time ×clock rate = 10 × 2 × 10 9 = 2 × 10 10 cycles/program. Now, we required 10% more clock cycles than on M 1 , so M 2 ’s clock cycles = 2 × 10 10 × 1.1 = 2.2 × 10 10 cycles/program. M 2 ’s clock rate = clockcycles CPU time = 2.2 × 10 10 4 = 5.5 × 10 9 cycles/sec = 5.5 GHz. So, M 2 ’s clock rate has to be 5.5 GHz. 6. Since performance of a machine for a program = 1 executionTime x .
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 7 pages?

  • Spring '17

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes