Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 212 Quiz 4 – 2/16/11 *Assume computes take 1 clock cycle, loads and stores take 10 cycles and branches take 4 cycles and that they are running on.

Similar presentations


Presentation on theme: "CSCE 212 Quiz 4 – 2/16/11 *Assume computes take 1 clock cycle, loads and stores take 10 cycles and branches take 4 cycles and that they are running on."— Presentation transcript:

1 CSCE 212 Quiz 4 – 2/16/11 *Assume computes take 1 clock cycle, loads and stores take 10 cycles and branches take 4 cycles and that they are running on a 2 GHz processor. *Show all work. 1.What would be the execution time of Program 1? 2.Which program would run faster and how much faster would it run? 3.What is the speed-up of Program 1 if you were able to reduce the number of compute instructions by one half? # Instr.ComputeLoadStoreBranch Program 1100040010050 Program 2180020080100

2 CSCE 212 Quiz 4 Answers 1.What would be the execution time of Program 1? # clock cycles = (1000*1)+(400*10)+(100*10)+(50*4) = 6200 Execution time = 6200 / 2 x 10 9 = 3.1 x 10 -6 sec

3 CSCE 212 Quiz 4 Answers 2.Which program would run faster and how much faster would it run? Program 1 = 3.1 x 10 -6 sec Program 2 = 2.5 x 10 -6 sec Program 2 is 3.1/2.5 or 1.24 times faster.

4 CSCE 212 Quiz 4 Answers 3.What is the speed-up of Program 1 if you were able to reduce the number of compute instructions by one half? Program 1 before = 3.1 x 10 -6 sec Program 1 after = 2.85 x 10 -6 sec Speed up is 3.1/2.85 or ~1.09 times faster.


Download ppt "CSCE 212 Quiz 4 – 2/16/11 *Assume computes take 1 clock cycle, loads and stores take 10 cycles and branches take 4 cycles and that they are running on."

Similar presentations


Ads by Google