=========================preview======================
(COMP180)quiz01S_2.pdf
Back to COMP180 Login to download
======================================================
COMP180: Computer Organization
Spring 2001, Lecture Section 1, Dit-Yan Yeung

Quiz #2
7 March 2001
Name: __________________________ Student ID: _______________ E-mail: _________________
Answer all questions in the space provided. Time allowed: 20 minutes
1. For each of the following statements, write down true if it is true and false otherwise.
(a)
The address field in an I-format instruction always represents an address offset in bytes. Ans: _____

(b)
RISC computers can usually accommodate more registers than CISC computers. Ans: _____

(c)
The instruction jal sort saves the value of $ra to the program counter before jumping to the instruction labeled sort. Ans: _____

(d)
A jump instruction can never jump beyond a range of 226 words. Ans: _____

(e)
Each real MIPS assembly instruction corresponds to only a single MIPS machine instruction. Ans: _____

(f)
Each MIPS pseudoinstruction corresponds to multiple MIPS machine instructions. Ans: _____

(g)
The MIPS instruction beq $s0, $s1, loop does not necessarily lead to the execution of the instruction labeled loop. Ans: _____

(h)
The pseudodirect addressing mode computes the target address by finding the sum of a full 32-bit address and an address offset. Ans: _____

(i)
The twos complement scheme can represent more numbers than the ones complement scheme. Ans: _____

(j)
The MIPS instruction addiu may lead to overflow. Ans: _____


1

2. The absolute value function is defined as:
x ifx 0
abs(x) =
...

. x otherwise
Give a sequence of real MIPS assembly language instructions which takes the value held in register $t0, applies the absolute value function to it, and then saves the result into register $t1.
3. Suppose the values of two registers $s0 and $s1 are 159e 5091 and ec25 7a15, respectively, in hexadecimal representation. Give the value of register $t1 in hexadecimal representation after performing the MIPS instruction add $t1, $s0, $s1 . Does this instruction lead to overflow?
2