The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
4.3k views

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.5k points)
edited by | 4.3k views
+6

Read this link to understand the concept of register window!

+4

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. 

+1
@tuhin

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
+1
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.
0
@tuhin

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.8k points)
selected by
+1
@Amar :What is the difference in terms of memory accesses in a and b.Actually register overlapping is not clear.Please hlp
+17

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

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

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

But then why is Option b wrong?

 

+5

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.

+2

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?

+6

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.

+2
is this still in course?
+4 votes
answered by Veteran (357k points)
0
Can't understand ..plz explain
0
Never  heard about this topic earlier...

Thank You so much sir. It helped a lot.
0
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..
Answer:

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

39,439 questions
46,623 answers
139,362 comments
57,009 users