Solve RISC CPU Questions - Confirm Answers

  • Thread starter Thread starter fran1942
  • Start date Start date
  • Tags Tags
    cpu
Click For Summary
The discussion revolves around confirming answers related to a RISC CPU's register window configuration. The user poses questions about the availability of registers for input and output parameters, the number of register windows, and the increment of the current window pointer (CWP) during procedure calls. The user initially answers that only one register is available for both input and output parameters and estimates 13 register windows, but later revises the CWP increment from 12 to 11. The calculations suggest that there are 26 total register windows, indicating a need for clarification on the register allocation and window structure. The thread highlights the complexity of RISC architecture and the importance of accurate calculations in understanding register usage.
fran1942
Messages
80
Reaction score
0
Hello, I am having some trouble with the following set of questions.
I include them along with my answers.
Would anyone be able to confirm if I am correct here ?
Thanks kindly for any help.

Suppose a RISC machine uses overlapping register windows for passing parameters between procedures. The machine has 298 registers, and each register window has 22 registers, of which 10 are global registers and 10 are local registers. Answer the following:

a) How many registers would be available for use by input parameters?
My attempted answer: 1

b) How many registers would be available for use by output parameters?
My attempted answer: 1

c) How many register windows would be available for use?
My attempted answer: 13

d) By how much would the current window pointer (CWP) be incremented at each procedure call ?
My attempted answer: By 12.
 
Last edited:
Physics news on Phys.org
I'm very rusty but nobody else has answered so...

As I recall with overlapping register windows the output register is at the end of the window so by incrementing the CWP the output resister of one proceedure automatically becomes the input register of the next proceedure. See drawing.

So I think the CWP only needs to be incremented by 11 not 12.

However that would mean the number of windows you can fit into 298 registers isn't a whole number so I'm probably wrong...

298 - 10 global = 288
but
288/11 = 26.18
 

Attachments

  • Registers.png
    Registers.png
    2 KB · Views: 741
  • Like
Likes 1 person
Well I can make the number fit by assuming that the CWP register is one of the 298 registers...

298 - 10 global - 1 CWP = 287

All the windows are 11 registers long except one which is 12 so

287 = 11*n + 12

n = 25 so there are 26 windows in all.
 
  • Like
Likes 1 person

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 23 ·
Replies
23
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
7
Views
14K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K