The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+18 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
asked in CO & Architecture by Veteran (59.4k points)
retagged by | 3.9k views

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?

2 Answers

+18 votes
Best answer

I. Functions locals and parameters
this is true because overlapped registers eliminates the need for memory accesses. we here got to use registers instead.

II. 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 refered. So NO memory accesses are reduced here.

III. Instruction fetches
it has nothing to do with reduction in memory accesses.

Hence, option A is correct.

answered by Boss (30.6k points)
selected 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?
+3 votes
answered by Veteran (339k points)
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..

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

34,781 questions
41,758 answers
41,400 users