Question

In: Computer Science

Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT...

Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT instructions, 80 × 106 L/S instructions, and 16 × 106 branch instructions. The CPI for each type of instruction is 1, 1, 4, and 2, respectively. Assume that the processor has a 2 GHz clock rate.

a. Find the execution time?

b. By how much must we improve the CPI of FP instructions if we want the program to run two times faster?

c. By how much must we improve the CPI of L/S instructions if we want the program to run two times faster?

d. By how much is the execution time of the program improved if the CPI of INT and FP instructions is reduced by 40% and the CPI of L/S and Branch is reduced by 30%?

Solutions

Expert Solution

Answer a

Execution time = Total Clock Cycles / Clock Rate

Total Clock cycles = (50 x 106 x 1) + (110 x 106 x 1) + (80 x 106 x 4) + (16 x 106 x 2) = 512 x 106

so, execution time = 512 x 106 / 2 x 109 Hz = 256 ms   

Answer b

Now, we want to execute program as 2 times faster by improving the clock cycle for FP instruction

so, assuming FP instruction takes P CPI

Total clock cycles   (50 x 106 x P) + (110 x 106​​​​​​​ x 1) + (80 x 106​​​​​​​ x 4) + (16 x 106​​​​​​​ x 2) = (462 + 50P) x 106

  Execution time = 256/2 = 128 ms

So, 128 x 10-3 s = (462 + 50P) x 106  / 2 x 109 Hz

462+50P = (128 x 10-3) (2 x 103) = 256

P = - 4.12

New CPI is in negative which means it is not possible to execute program two times faster by Improving the clock cycle of FP instructions

Answer c

Now, we want to execute program 2 times faster by improving the clock cycle for L/S instruction

so, assuming L/S instruction takes P CPI

Total clock cycles   (50 x 106 x 1) + (110 x 106​​​​​​​ x 1) + (80 x 106​​​​​​​ x P) + (16 x 106​​​​​​​ x 2) = (192 + 80P) x 106

  Execution time = 256/2 = 128 ms

So, 128 x 10-3 s = (192 + 80P) x 106  / 2 x 109 Hz

192+80P = (128 x 10-3) (2 x 103) = 256

P = 0.8

Answer d

(Execution time)new = Total Clock Cycles / Clock Rate

Total Clock cycles = (50 x 106 x 0.6) + (110 x 106 x 0.6) + (80 x 106 x 2.8) + (16 x 106​​​​​​​ x 1.4) = 342.4 x 106

so, (Execution time)new = 342.4 x 106 / 2 x 109 Hz = 171.2 ms   

Speedup = Execution Time / (Execution time)new = 256/171.2 = 1.495


Related Solutions

Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions...
Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions below could be used to set the next value of PC to 0x0FFFFFF4 j, jr, bne, jal, beq
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction...
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction count=1.0E9). CPI_A= 1 and CPI_B=2 The processor A has a clock cycle time of 1 ns. And the processor B has a clock cycle time 2 ns. A).To execute the same program Pro, which processor is faster and by how much? B). To improve the slower processor in problem 1a, what can you do? (list all possible solutions)
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume...
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume the following input data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63...
The program will loop, asking the user for a bet amount from 0 to 50 (assume...
The program will loop, asking the user for a bet amount from 0 to 50 (assume dollars, you can use ints or longs). If the user types a 0 that means she wants to quit. Otherwise, accept the amount as their bet and simulate a slot machine pull. Your program will print out a line that looks like a slot machine result containing three strings. Some examples are:  BAR 7 BAR, 7 7 cherries, cherries BAR space, space BAR BAR, or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT