# Homework Help: RISC CPU question

1. May 22, 2013

### fran1942

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: May 22, 2013
2. May 25, 2013

### CWatters

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

#### Attached Files:

• ###### Registers.png
File size:
2.9 KB
Views:
249
3. May 25, 2013

### CWatters

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.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted