After graduating you are asked to become the lead computerdesigner at X Computer
ID: 3616461 • Letter: A
Question
After graduating you are asked to become the lead computerdesigner at X Computers, Inc. Your study of usage of high-levellanguage constructs suggests that procedure calls are one of themost expensive operations. You have invented a scheme that reducesthe loads and stores normally associated with procedure calls andreturns. The first thing you do is run some experiments with andwithout this optimization. Your experiments use the samestate-of-the-art optimizing compiler that will be used with eitherversion of the computer. These experiments reveal the followinginformation:
Which is faster? Justify your decision quantitatively.
Explanation / Answer
Assuming clock rate of optimized version as C. Then the clock rate of un-optimized version is 5% higher thanC...i.e. 1.05C Given that 30% of instructions on un-optimized version are loadsand stores and other instructions constitute 70% Let the total number of instructions be T Then time taken by un-optimized version = (0.3T) * C +To [To is the time takento execute other instructions] Time taken by optimized version = [(0.3T *2/3) * 1.05 C]+To = (0.2 * 1.05) TC +To = 0.21TC +To which is less than that of un-optimized version[0.3TC + To] Therefore the optimized version is faster than that of unoptimizedversion
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.