Computer Organization Homework 2: Minimize
Computer Organization Homework 2: Minimize
Computer Organization Homework 2: Minimize
3) For the MIPS assembly instructions in Exercise 2, rewrite the assembly code
to minimize the number if MIPS instructions (if possible) needed to carry
out the same function.
00011010010000000000000000000011
00100000000000000000000000000000
10101110001010110000000000000000
10101110001010100000000000000010
00100001001010010000000000001000
7) Pseudo-instructions are not part of the MIPS instruction set but often appear
in MIPS programs. The assembler then has to convert them into a small set
of real MIPS instructions. For each of the following pseudo-instructions,
convert them to a very short equivalent sequence of real MIPS instructions.
If you need a temporary register, you should use $at.
Note that “small” is a constant that fits in 16 bits (i.e. small enough for the
immediate field of an instruction), and “big” is a constant that is 32 bits (i.e.
too long for the immediate field).
8) Assume that we would like to expand the MIPS register fi le to 128 registers
and expand the instruction set to contain four times as many instructions.
a. How this would this affect the size of each of the bit fields in the R-type
instructions?
b. How this would this affect the size of each of the bit fields in
the I-type instructions?
9) Find the shortest sequence of MIPS instructions that extracts bits 16 down to
11 from register $t0 and uses the value of this field to replace bits 31 down
to 26 in register $t1 without changing the other 26 bits of register $t1.
The end