Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times as many instructions. 1. How this would this affect the size of each of the bit fields in the R-type instructions? 2. How this would this affect the size of each of the bit fields in the I-type instructions? 3. How could each of the two proposed changes decrease the size of an MIPS assembly program? On the other hand, how could the proposed change increase the size of an MIPS assembly program?

Respuesta :

Answer:

Explanation:

1) Effect on R-type instructions:

log2(128) = 7 [since 128=27]

opcode = 6

rs = 7

rt = 7

rd = 7

shamt = 5

funct = 6

Here all the bits ends up with 2 additional bits. As there are 6 bits for opcode in R-type instruction the size of word is 44.

.2) Effect on I-type Instruction:

log2(128) = 7 [since 128=27]

opcode = 6

rs = 7

rt = 7

immediate = 16

The word size of the I-type instruction is also 44.

3)

The programs will take long time to do the operations if the instruction encoding is long.

It means the format must be larger as the increases are not aligned.

The code will decrease if there are more registers.

Because more registers can hold more information without going to memory.

As this leads to fewer calls to load or store the code will decrease.

Number of bits needed to address a register is 7 bits

MIPS register file :

Given information in question:

Number of MIPS registers = 128

Number of bits needed = log₂128

Number of bits needed = 7 bits

Increasing number bits for opcode = (6 + 2)

Increasing number bits for opcode = 8

Computation:

1. R-type instruction

Op-code = 6 bits

rs = 5 bits

rt = 5 bits

rd = 5 bits

shamt = 5 bits

funct = 6 bits

The size of the opcode field will be increased by two bits, to eight bits.

The size of the rs,rt, and rd fields is also increased to 7 bits.

2.I-type instruction

Op-code = 6 bits

rs = 5 bits

rt = 5 bits

Immediate = 16 bits

The size of the opcode field will be increased by two bits, to eight bits.

The size of the rs,rt  fields is also increased to 7 bits.

3. More complicated operations will be implemented in one instructions rather than numerous instructions as a result of the reduced register leaking problem. The program's size will be reduced as a result of this.

The size of the instruction word will be raised when the needed bits are added to the opcode and register fields, which will increase the size of the programmed.

Find out more information about 'Opcode'.

https://brainly.com/question/15584075?referrer=searchResults