Log In
27 votes

The use of multiple register windows with overlap causes a reduction in the number of memory accesses for:

  1. Function locals and parameters

  2. Register saves and restores

  3. Instruction fetches

  1. $I$ only
  2. $II$ only
  3. $III$ only
  4. $I$, $II$ and $III$
in CO and Architecture
edited by

Read this link to understand the concept of register window!


The following paragraphs give good insight on RISC design and its associated Register Window

Berkeley RISC added circuitry to the CPU to "help" the compiler by using the concept of register windows, in which the entire "register file" was broken down into blocks, allowing the compiler to "see" one block for global variables, and another for local variables.

The idea was to make one particularly common instruction, the procedure call, extremely easy to implement in the compilers. Almost all computer languages use a system known as an activation record or stack frame for each procedure—a modular unit of execution—that contains the address from which the procedure was called, the data (parameters) that were passed in, and space for any result values that need to be returned. In the vast majority of cases these frames are small, typically with three or fewer inputs and one or no outputs (and sometimes an input is reused as an output). In the Berkeley design, then, a register window was a set of several registers, enough of them that the entire procedure stack frame would most likely fit entirely within the register window.

In this case, the call into and return from a procedure is simple and extremely fast. A single instruction is called to set up a new block of registers—a new register window—and then, with operands passed into the procedure in the "low end" of the new window, the program jumps into the procedure. On return, the results are placed in the window at the same end, and the procedure exits. The register windows are set up to overlap at the ends, so that the results from the call simply "appear" in the window of the caller, with no data ( Function locals and parameters ) having to be copied. Thus the common procedure call does not have to interact with main memory, greatly accelerating it.

On the downside, this approach means that procedures with large numbers of local variables are problematic, and ones with fewer lead to registers—an expensive resource—being wasted. There are a finite number of register windows in the design, e.g. eight, so procedures can only be nested that many levels deep before the register windowing mechanism reach its limit; once the last window is reached, no new window can be set up for another nested call. 


it maintains its own set of registers and saves function values and parameters in that

so OPTION B register saves and restores neednt acces memory right ?

why option B is wrong
Register windows( a limited set of registers or a register file ) try to save memory access by overlapping them so that they can be used efficiently for storing function return values, locals, and parameters. Here they are not used to save register saves and restores rather use them as much as possible so that we don't need memory access much thus saving a whole lot of time.

in order to store the function values in registers in has to access the memory

so register saves requires access to memory

am i right in my understanding?

Thank you @Tuhin Dutta, the explanation was very helpful.

Thanks for sharing the link, it is really helpful

This might help.

3 Answers

31 votes
Best answer
  1. Functions locals and parameters
    this is true because overlapped registers eliminates the need for memory accesses. we here got to use registers instead.
  2. Register saves and restores
    this is false bc we need to see where memory accesses are reduced here before also we were using register as it says Register saves... later also (i.e. after using multiple register windows) registers will are referred. So NO memory accesses are reduced here.
  3. Instruction fetches
    it has nothing to do with reduction in memory accesses.

Hence, option (A) is correct.

edited by
@Amar :What is the difference in terms of memory accesses in a and b.Actually register overlapping is not clear.Please hlp

these are some types of register in a RISC architecture :

  • global registers : every register window has access to each of them
  • in register
  • local register
  • out register

a register window comprises of 3 registers = {in+local+out} and has access to all global registers too.

out registers are missing from the above equation because, in case of register windows are overlapping with their adjacent register windows, say a system of 4 Register Windows looks like :

so what is In register for a window is Out register for the adjacent overlapping one.

Application : 
They are allocated to adjacently executing procedures so that the passing of parameters and result is made efficient.
This also eliminates the 
need for saving and restoring register values

Thanks @Amar for such a wonderful explaination but still can't understand why option B should not be the answer

"This also eliminates the need for saving and restoring register values"

But then why is Option b wrong?



Question asks if Memory Accesses are reduced!
Option B talks of Register saves and restores.
Memory Accesses != Register Accesses

Hence, option B cannot affect/reduce the number of memory accesses.


If there are no Register windows, then register values will be saved and restored from memory,is it not? Using the window reduces such access, right?


the question wants to ask
When we do
option ____ while overlapping registers are also available, are memory accesses reduced?

So, when we do option B with overlapping registers or without, it has nothing to do with reduction in memory accesses.

is this still in course?
what's the answer in the answer key to the problem.

@Arjun sir @Bikram sir

doesn't option B means register values save & restore ? Because we know , during subroutine CALL & RETURN, we save PSW ,PC & some other resgiter values used by calling program to memory... 

​​​​So both A & B should be true... 

4 votes
Can't understand ..plz explain
Never  heard about this topic earlier...

Thank You so much sir. It helped a lot.
Option A is correct

The use of multiple register window with overlap cause a reduction in number of memory access for function local and parameters because overlapped register eliminate the need of memory register..
1 vote
→ I is true because when we make a function call there are some input registers and some output registers. If function F() is calling function G(), we can make the caller function F()'s output registers the same as the called procedure G()'s input registers this is done using overlapping register windows.This will reduce the memory accesses so that F()'s output need not be put into memory for G() to access again from memory.
→ II is false as register saves and restores would still be required for each and every variable.
→ III is also false as instruction fetch is not affected by memory access using multiple register windows.

Related questions

39 votes
3 answers
Which of the following is/are true of the auto-increment addressing mode? It is useful in creating self-relocating code If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation The amount of increment depends on the size of the data item accessed I only II only III only II and III only
asked Sep 12, 2014 in CO and Architecture Kathleen 8.4k views
30 votes
6 answers
Which of the following statements about synchronous and asynchronous I/O is NOT true? An ISR is invoked on completion of I/O in synchronous I/O but not in asynchronous I/O In both synchronous and asynchronous I/O, an ISR (Interrupt Service Routine) is invoked after completion of ... /O, the process waiting for the completion of I/O is woken up by the ISR that is invoked after the completion of I/O
asked Sep 12, 2014 in CO and Architecture Kathleen 8.4k views
22 votes
4 answers
Consider a pipelined processor with the following four stages: IF: Instruction Fetch ID: Instruction Decode and Operand Fetch EX: Execute WB: Write Back The IF, ID and WB stages take one clock cycle each to complete the operation. The number of clock cycles for the EX stage depends on the instruction. The ... $ R5$-$R4} \\ \end{array}$ $7$ $8$ $10$ $14$
asked Sep 22, 2014 in CO and Architecture Kathleen 6.7k views
34 votes
6 answers
In an instruction execution pipeline, the earliest that the data TLB (Translation Lookaside Buffer) can be accessed is: before effective address calculation has started during effective address calculation after effective address calculation has completed after data cache lookup has completed
asked Sep 12, 2014 in CO and Architecture Kathleen 6.3k views