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 Program
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 sec
CSCE 212 Quiz 4 Answers 2.Which program would run faster and how much faster would it run? Program 1 = 3.1 x sec Program 2 = 2.5 x sec Program 2 is 3.1/2.5 or 1.24 times faster.
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 sec Program 1 after = 2.85 x sec Speed up is 3.1/2.85 or ~1.09 times faster.