24.5k views
2 votes
Suppose you have a machine which executes a program consisting of 60% floating point multiply, 20% floating point divide, and the remaining 20% are from other instructions.

(a) [3] Management wants the machine to run 4 times faster. You can make the divide run at most 3 times faster and the multiply run at most 8 times faster. Can you meet management’s goal by making only one improvement, and which one?
(b) [2] Dogbert has now taken over the company removing all the previous managers. If you make both the multiply and divide improvements, what is the speed of the improved machine relative to the original machine?

User Nodebase
by
5.8k points

2 Answers

2 votes

Final answer:

Neither improving just the divide nor the multiply operation alone can meet management's goal of a fourfold increase in speed. However, when both improvements are made, the machine can achieve a significant increase in speed, though additional calculations are required for an exact number.

Step-by-step explanation:

To determine if improvements in divide or multiply operations will achieve a fourfold increase in overall machine speed, we must consider the contribution of each to the total execution time. Amdahl's Law can help in this calculation, which states that the overall speedup of a system is limited by the portion of the system which cannot be improved. Here we calculate the impact of improving either the divide or multiply operations, taking the current proportion of time spent on each operation into consideration. For the divide operation, the time spent is 20%, so a threefold speedup means the new time spent on divide would be approximately 6.67% of the original time. For the multiply operation, the time spent is 60%, and an eightfold speedup means this time would be reduced to 7.5%. However, neither improvement alone can achieve the desired fourfold increase in machine speed.

When both improvements are made, we can calculate the overall speedup by summing contributions. The 60% of the time for multiply can be reduced to 7.5%, and the 20% of the time for divide to 6.67%. This means the machine would be spending less than 14.17% of its original time on these operations, resulting in significant speed enhancement. Using the speedup formula, we can infer that the overall machine speed would greatly increase, though further calculation is necessary to determine the exact factor by which it would improve.

User Validcat
by
5.0k points
5 votes

Answer:

Given that Program instructions consists of:

  • 60% floating point multiply
  • 20% floating point divide
  • 20% other instructions

Amdahl's law states that:

Execution time affected by improvement = (Execution time after improvement/ Amount of improvement) + (Execution time unaffected)

Assuming initially that floating point multiply, divide and other instructions have same clocks per instruction (CPI).

Part (a)

New execution time after improvement with multiply = (60) / 8 + (20 + 20) = 47.5

New execution time after improvement with Divide = (20) / 3 + (60 + 20) = 86.67

New system should be 4x faster which means new execution time should be below = 100/ 4 = 25.

Therefore, Management's goal can NOT be achieved by making the improvement with multiply or divide alone.

Part (b)

New execution time after improvement with multiply and divide = (60 / 8) + (20 / 3) + 20 = 34.17

Speed up = execution time of original machine / Execution time of new machine = (100 / 34.17) = 2.93

Therefore, new machine is 2.93 times faster than original machine.

User Samantha Withanage
by
6.4k points