Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a RISC machine with 8 register windows. There are 16 global registers.

ID: 3770581 • Letter: C

Question

Consider a RISC machine with 8 register windows. There are 16 global registers. There are 10 registers for creating local variables in each window. There are 4 registers that overlap between windows. Also, because of the circular nature of the windows, the outgoing registers of the last window overlap with the incoming registers of the first window.

a. How many registers would be available for use by incoming parameters?

b. How many registers would be available for outgoing parameters?

c. What is the total number of registers in the machine?

d. By how much would the current window pointer (CWP) be advanced at each procedure call?

Explanation / Answer

Answer:

a) Each window contains 32 registers

   global registers= 16

   local registers = 10

   total of global and local = 16+10=> 16

total of incoming and outgoing registers= 32 – total of global and local

                                                                           = 32 – 16

                                                                           =16

Number of incoming registers= 16/2

Thus, 8 registers would be available for use by incoming parameters

-----------------------------------------------------------------------------------------------

b) 8 registers would be available for outgoing parameters

----------------------------------------------------------------------------------------------

c.) The total number of registers required: for (windowSize=8) RISC machine:

=16 global registers +( windowSize x 10 local registers) + (windowSize x 4 parameter transfer registers)

=16 + 80+32

=>290 registers

-------------------------------------------------------------------------------------------------------------

d) Current winodow pointer (CWP) is advanced by one at each procedure call.

-------------------------------------------------------------------------------------------------------------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote