Created 06/19/03; edited: 02/17/08, 02/27/11


QUIZ on Chapter 13

Instructions: For each question, choose the single best answer. Make your choice by clicking on its button. You can change your answers at any time. When the quiz is graded, the correct answers will appear with each question.



1.   What is a trap?

A.   A trap is an instruction that captures data.
B.   A trap is a shortened version of a normal 32-bit instruction.
C.   A trap is an interruption in the normal machine cycle.
D.   A trap is a bus signal that says that something is wrong.

2.   Write the instruction that adds the contents of registers $8 and $9 and puts the result in register $13.

A.   add $8,$9,$13
B.   addu $9,$8,$13
C.   addi $8,$9,$13
D.   addu $13,$8,$9

3.   Write the instruction that adds the contents of registers $4 and $5 and puts the result in register $8, and which might cause a trap.

A.   addu $4,$5,$8
B.   add $8,$5,$4
C.   addu $8,$4,$5
D.   add $5,$8,$4

4.   The following is an 8-bit two's complement representation of minus 7.

1111 1001

Which of the following is a 16-bit representation of a minus sever?

A.   
1111 0000 1111 1001
B.   
1111 1111 1111 1001
C.   
1111 1001 0000 0000 
D.   
1111 1001 1111 1111

5.   Write an instruction that adds the value 12 to the value in register $6. Use an instruction which ignores overflow.

A.   addiu $6,$6,12
B.   addiu $6,$6,$12
C.   addiu $6,$0,12
D.   addi $6,$6,12

6.   Write an instruction that adds the value 1 to the value in register $10. Use an instruction which ignores overflow.

A.   addiu $10,1,0
B.   addiu 1,$10,$10
C.   addiu $10,$10,1
D.   addiu $10,$0,1

7.   Write an instruction that decrements the value in register $10. Use an instruction which ignores overflow.

A.   addiu $10,-1
B.   subu $10,$10,$10
C.   subiu $10,$10,1
D.   addiu $10,$10,-1

8.   What integer subtraction instruction uses two operand registers, one result register, and does not trap if overflow is detected?

A.   subu
B.   subiu
C.   sub
D.   subi

9.   Which instruction loads register $17 with a -99?

A.   addiu $17,$0,-99
B.   sub $17,$17,-99
C.   subu $17,$0,99
D.   addi $17,$0,99

10.   Here is a 16-bit two's complement negative one written in hex: FFFF

Write a 32-bit negative one in hex:

A.   FFFFFFFF
B.   FFFFFF
C.   FFFF0000
D.   0000FFFF


Click here