1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

RISC CPU question

  1. May 22, 2013 #1
    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. jcsd
  3. May 25, 2013 #2


    User Avatar
    Science Advisor
    Homework Helper

    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
    288/11 = 26.18

    Attached Files:

  4. May 25, 2013 #3


    User Avatar
    Science Advisor
    Homework Helper

    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.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: RISC CPU question
  1. Wanna design a cpu? (Replies: 12)

  2. 3-bus CPU (Replies: 13)

  3. Performance of the CPU (Replies: 7)