Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.16: Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times as

2.16:

image text in transcribed

image text in transcribed

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 affect the size of each of the bit fields in the R-type instructions How this would 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? Expert Answer schajacob answered this 710 answers | 3 | | Was this answer helpful? 2 Definition of MIPS The number of MIPS (million instructions per second) is a general measure of computing performance and, by implication, the amount of work a larger computer can do. For large servers or mainframes, MI PS is a way to measure the cost of computing: the more MIPS delivered for the money, the better the value. 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: The entire MIPS architecture is basedl around the fact that instructions are easy to decode and each instruction takes exactly one 32-bit machine word, which considerably simplifies lots of things: you always jump a multiple of 4 bytes, you ahways get to fit a round number of nstructions on a cache line, etc. To have 38-hit instructionswould pntirely ruin the elegant MIPS The compromise chosen by the MIPS designers is to keep all instructions the same length, thereby requiring different kinds of instruction formats for different kinds of instructions. For example, the format above is called R-type (for register) or R-format. A second type of instruction format is called I-type (for immediate) or l-format and is used by the immediate and data transfer instructions. The fields of I-format Here is the meaning of each name of the fields in MIPS instructions: op: Easic operation of the instruction, traditionally called the opcode. rs: The first register source operand. rt: The second register source operand. rd: The register destination operand. It gets the result of the operation. shamt: Shift amount, it will not be used until then, and hence the field contains zero in this section. funct: Function. This field, often called the function code, selects the specific variant of the operation in the op field 1. How this would affect the size of each of the bit fields in the R-type instructions: 128 Registers,38 bits for each. Register bits: log2/128) opcodel6rrd shamt functie R-tyoe instructions use the opcode 0 and the funct to denote the operation. Using an unused opcode (there are many) and the same funct combinations, all instructions with base addressing can be added. The length of the immediate was unspecified . . 16 is a good choice since it is a half word, and the size used in -type instructions. However, no instruction that uses the shamt field can have base addressing as asked in the question, so it is possible to use the shamt field and allow only 5-bit offsets and retain the instruction ength. 2. How this would affect the size of each of the bit flelds in the l-type instructions: 128 Registers 36 bits. Register bits: log2 (128)-7 opcode (,) | rs (7) | rt (7 | immediate(16) Two acceptable answers: 1. No change using the assumption that the definition of an immediate must be an integer constan 2. 37 bits for an instruction of the form addi Sa0. Ss1,0St1). We will need to add another 5 bits to incorporate the register data. opcode rsrt mmediate 215) 3.How could each of the two proposed changes decrease the size of an MIPS assembly program: 126 Registers Longer instruction-encoding means longer programs that do the same operations. The instruction formats may be even larger than indicated above since the increases aren't byte-aligned and addressing subsequent instructions is difficult. It also breaks the MIPS tenet of fixad-length instructions. Programs may decrease in size because more registers means you can 'hold onto more data in the processor without going aut to memory, leading to fower load/store instructions If the sharnt field is used, the program will not grow larger with this addition, though it may grow smaller Howaver, adcing hase-addressing still adds complexity to the processor that may slow the program down. It is also less useful with just 5-bit offsets 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 affect the size of each of the bit fields in the R-type instructions How this would 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? Expert Answer schajacob answered this 710 answers | 3 | | Was this answer helpful? 2 Definition of MIPS The number of MIPS (million instructions per second) is a general measure of computing performance and, by implication, the amount of work a larger computer can do. For large servers or mainframes, MI PS is a way to measure the cost of computing: the more MIPS delivered for the money, the better the value. 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: The entire MIPS architecture is basedl around the fact that instructions are easy to decode and each instruction takes exactly one 32-bit machine word, which considerably simplifies lots of things: you always jump a multiple of 4 bytes, you ahways get to fit a round number of nstructions on a cache line, etc. To have 38-hit instructionswould pntirely ruin the elegant MIPS The compromise chosen by the MIPS designers is to keep all instructions the same length, thereby requiring different kinds of instruction formats for different kinds of instructions. For example, the format above is called R-type (for register) or R-format. A second type of instruction format is called I-type (for immediate) or l-format and is used by the immediate and data transfer instructions. The fields of I-format Here is the meaning of each name of the fields in MIPS instructions: op: Easic operation of the instruction, traditionally called the opcode. rs: The first register source operand. rt: The second register source operand. rd: The register destination operand. It gets the result of the operation. shamt: Shift amount, it will not be used until then, and hence the field contains zero in this section. funct: Function. This field, often called the function code, selects the specific variant of the operation in the op field 1. How this would affect the size of each of the bit fields in the R-type instructions: 128 Registers,38 bits for each. Register bits: log2/128) opcodel6rrd shamt functie R-tyoe instructions use the opcode 0 and the funct to denote the operation. Using an unused opcode (there are many) and the same funct combinations, all instructions with base addressing can be added. The length of the immediate was unspecified . . 16 is a good choice since it is a half word, and the size used in -type instructions. However, no instruction that uses the shamt field can have base addressing as asked in the question, so it is possible to use the shamt field and allow only 5-bit offsets and retain the instruction ength. 2. How this would affect the size of each of the bit flelds in the l-type instructions: 128 Registers 36 bits. Register bits: log2 (128)-7 opcode (,) | rs (7) | rt (7 | immediate(16) Two acceptable answers: 1. No change using the assumption that the definition of an immediate must be an integer constan 2. 37 bits for an instruction of the form addi Sa0. Ss1,0St1). We will need to add another 5 bits to incorporate the register data. opcode rsrt mmediate 215) 3.How could each of the two proposed changes decrease the size of an MIPS assembly program: 126 Registers Longer instruction-encoding means longer programs that do the same operations. The instruction formats may be even larger than indicated above since the increases aren't byte-aligned and addressing subsequent instructions is difficult. It also breaks the MIPS tenet of fixad-length instructions. Programs may decrease in size because more registers means you can 'hold onto more data in the processor without going aut to memory, leading to fower load/store instructions If the sharnt field is used, the program will not grow larger with this addition, though it may grow smaller Howaver, adcing hase-addressing still adds complexity to the processor that may slow the program down. It is also less useful with just 5-bit offsets

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

b. Compute the variance. Pg45

Answered: 1 week ago