A RISC processor implements a subroutine call using a link register (i.e., the return address is saved in the link register).The cost of a call is 2 cycles and the return costs 1 cycle. If a subroutine is called from another subroutine (i.e., the subroutine is nested), the contents of the link register must be saved and later restored. The cost of saving the link register is 6 cycles and the cost of restoring the link register is 8 cycles. Assume that a certain instruction mix contains 20% subroutine calls and returns (i.e., 10% calls, 10% returns). The probability of a single subroutine call and return without nesting is 60%. The probability that a subroutine call will be followed by a single nested call is 40%. Assume that the probability of further nesting is vanishingly small. What is

the overall cost of subroutine calls? The average call of all other instructions is 1.5 cycles. What is the average number of cycles per instruction?

What will be an ideal response?


There are five possibilities: an instruction is not a subroutine call or return, it is a single call, it is a nested call, it is

a single return, it is a nested return. Note that when a subroutine is nested, it has the unnested call return plus

the extra save/return time. The probabilities and costs are:



Computer Science & Information Technology

You might also like to view...

You can choose to have a task automatically ____ itself to keep the task from ending.

A. regenerate B. repeat C. re-sequence D. re-prioritize

Computer Science & Information Technology

Write a conditional expression that will be true for all values of the variable x in the given range and false for all values outside the given range. Note that the variable x can take on any value, not just integer values.

Between 1 and 5 including end points

Computer Science & Information Technology

case "Monday" is an example of a ____________________ data type being used as a case label.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

What is a column drop?

What will be an ideal response?

Computer Science & Information Technology