P. 1
PracticeProblems-COA8e

# PracticeProblems-COA8e

|Views: 2,417|Likes:

### Availability:

See more
See less

12/14/2012

pdf

text

original

11.1 Suppose that on a MIPS system, registers \$10 and \$15 contains the following 32-bit
binary data

\$10= 1111 1111 1111 1111 1111 1111 1001 0110 = –106 signed or 4294967190 unsigned
\$15= 0000 0000 0000 0000 0000 0000 0001 0001 = 17

What is the value of register \$20 after execution of:
a. sra \$20, \$10, 5
b. lui \$20, 20
c. srl \$20, \$10, 3
d. sltu \$20, \$10, \$15
e. sltiu \$20, \$10, 20
f. slti \$20, \$10, –20
g. slt \$20, \$10, \$15
Note: please refer to MIPS_Instruction_Reference.pdf in the Useful Documents
section of this book's Web site.

11.2 Hand-assemble the following (Mini-)MIPS assembly-language code fragment to
correct machine language. Fill in your answer in binary in two rows of 32 bits
each. Also, annotate your answer to clearly delineate all of the fields of each
instruction.

Also, indicate the format type of each instruction (I, J, R) by writing the
appropriate letter to the left of its row.
Finally, write out the corresponding machine-language code as a pair of