SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
Alternative Architectures
Exercise:
Exercises
Question:5 | ISBN:9780763704445 | Edition: 3

Question

5. A RISC processor has 8 global registers and 10 register windows. Each window has 4 input registers, 8 local registers, and 4 output registers. How many total registers are in this CPU? (Hint: Remember, due to the circular nature of the windows, the output registers of the last window are shared as the input registers of the first window.)

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

Given data:

  • Global registers: 8
  • Register windows: 10
  • Input registers per window: 4
  • Local registers per window: 8
  • Output registers per window: 4

To calculate the total number of registers, we can sum up the individual counts:

Total global registers = 8

Total input registers = Input registers per window * Number of windows Total input registers

                               = 4 * 10

                                = 40

Total local registers = Local registers per window * Number of windows Total local registers

                               = 8 * 10

                                = 80

Total output registers = Output registers per window * Number of windows Total output registers

                                    = 4 * 10

                                     = 40

However, due to the circular nature of the windows, the output registers of the last window are shared as the input registers of the first window. Therefore, we need to subtract the number of shared registers from the total output registers:

Number of shared registers = Number of output registers Number of shared registers = 40

Total registers = Total global registers + Total input registers + Total local registers + (Total output registers - Number of shared registers) Total registers

                        = 8 + 40 + 80 + (40 - 40)

                         = 8 + 40 + 80 + 0

Total registers = 128

 

Hence, the CPU has a total of 128 registers.

0 0

Discussions

Post the discussion to improve the above solution.