33.8k views
2 votes
Consider three different processors P1, P2, and P3 executing the same instructions set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz and CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2.

a. which processor has the highest performance expressed in instruction per second?
b. If the processors each execute a program in 10 seconds, find the number of cycles and the number of instructions.
c. We are trying to reduce the execution time by 30% but this leads to an increase of 20% in the CPI. What clock rate should we have to get this time reduction.

User Albane
by
5.6k points

2 Answers

3 votes

Final answer:

P2 has the highest performance at 2.5 billion instructions per second. For a program executed in 10 seconds, the number of cycles and instructions varies for each processor. To reduce execution time by 30% with a 20% higher CPI, a new clock rate must be calculated which depends on the original CPI and clock rate.

Step-by-step explanation:

To determine which processor has the highest performance expressed in instruction per second, we need to calculate the instructions per second for each processor. Processor performance in instructions per second can be calculated by dividing the clock rate (in hertz) by the CPI (Cycles Per Instruction).

a. For P1, at 3 GHz (or 3 billion cycles per second) with a CPI of 1.5, the performance is 2 billion instructions per second (IPS). For P2, at 2.5 GHz with a CPI of 1.0, the performance is 2.5 billion IPS. Finally, for P3, at 4.0 GHz with a CPI of 2.2, the performance is 1.818 billion IPS. Thus, P2 has the highest performance of 2.5 billion instructions per second.

b. If all processors execute a program in 10 seconds, then the number of cycles required for each processor can be found by multiplying the clock rate by the time in seconds. For P1, this is 30 billion cycles; for P2, this is 25 billion cycles; and for P3, this is 40 billion cycles. The number of instructions can be found by dividing the number of cycles by the CPI. Thus, for P1, this is 20 billion instructions; P2 also performs 25 billion instructions; and P3 performs 18.18 billion instructions.

c. To achieve a 30% reduction in execution time with a 20% increase in CPI, we must calculate the new required clock rate. If the execution time is reduced by 30%, we are left with an execution time that is 70% of the original time. If the CPI increases by 20%, we multiply the original CPI by 1.20. To find the new clock rate, we divide the original performance (in instructions per second) by the new CPI and then convert that number to the required cycles per second (hertz).

User Abyversin
by
5.9k points
2 votes

Answer:

Answer explained below

Step-by-step explanation:

The time taken by a processor of speed n Hz to finish one cycle is 1/n seconds. CPI is Cycles Per Instruction which indicates the number of cycles taken by an instruction to finish execution.

For P1:

clock rate = 3.5GHz which means time for one cycle = 1/(3.5 x 109) = 0.285 ns

CPI = 1.5

which means time taken to complete one instruction = 0.285 x 1.5 = 0.428 ns

Number of instructions executed in one second = 2.33 x 109 instructions

For P2:

clock rate = 3.0GHz which means time for one cycle = 1/(3.0 x 109) = 0.333 ns

CPI = 1.0

which means time taken to complete one instruction = 0.333 x 1.0 = 0.333 ns

Number of instructions executed in one second = 3 x 109 instructions

For P3:

clock rate = 4.0GHz which means time for one cycle = 1/(4.0 x 109) = 0.25 ns

CPI = 2.2

which means time taken to complete one instruction = 0.25 x 2.2 = 0.55 ns

Number of instructions executed in one second = 1.82 x 109 instructions

a. From the above calculations we can see that processor P2 has the highest performance as it executes the highest number of instructions per second.

b. All the processors execute one program in 10 seconds. Number of instructions executed in 10 seconds = number of instructions in one second x 10. Number of cycles = number of instructions x CPI

For P1:

Number of instructions executed in one program = 2.33 x 1010 instructions

Number of cycles taken by a program = 2.33 x 1010 instructions x 1.5 CPI = 3.5 x 1010cycles

For P2:

Number of instructions executed in one program = 3.0 x 1010 instructions

Number of cycles taken by a program = 3.0 x 1010 instructions x 1.0 CPI = 3.0 x 1010cycles

For P3:

Number of instructions executed in one program = 1.82 x 1010 instructions

Number of cycles taken by a program = 1.82 x 1010 instructions x 2.2 CPI = 4.0 x 1010cycles

c.

Assuming the CPI should be same, To reduce execution time by 30% the processor has to execute the number of instructions it executes in 10 seconds in 7 seconds.

For P1:

Number of instructions executed in one program = 2.33 x 1010 instructions

Number of instructions executed in one second = 2.33 x 1010 / 7 = 3.33 x 109 instructions

this means one instruction is executed in 0.3ns which implies one cycle takes 0.3/1.5 = 0.2 ns

The clock speed should therefore be, 5.0GHz

For P2:

Number of instructions executed in one program = 3.0 x 1010 instructions

Number of instructions executed in one second = 3.0 x 1010 / 7 = 4.28 x 109 instructions

this means one instruction is executed in 0.23ns which implies one cycle takes 0.23/1.0 = 0.23 ns

The clock speed should therefore be, 4.28GHz

For P3:

Number of instructions executed in one program = 1.82 x 1010 instructions

Number of instructions executed in one second = 1.82 x 1010 / 7 = 2.6 x 109 instructions

this means one instruction is executed in 0.385ns which implies one cycle takes 0.385/1.5 = 0.26 ns

The clock speed should therefore be, 3.9GHz

User Moyed Ansari
by
4.8k points