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


QUIZ on Chapter 12

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.   Shift left logical the following bit pattern by one position:

0011 1111

A.   
0011 1111
B.   
0001 1111
C.   
0111 1110
D.   
0111 1111

2.   Shift left logical the following bit pattern by two positions:

0011 1111

A.   
0001 1111
B.   
1111 1100
C.   
1111 1111
D.   
0111 1110

3.   Here is a program that loads register $5 with a bit pattern. Complete the program so the pattern in register $5 shifted left logical by 4 positions.

    ori      $5, $0, 0x900F     # put a bit pattern into register $5
    sll      ___, ___, ___      # shift left logical by four, put
                                # pattern remains in register $5

A.   sll $5, $5, $4
B.   sll $4, $5, $5
C.   sll $5, $0, 4
D.   sll $5, $5, 4

4.   Which of the following instructions has the effect of multiplying the unsigned integer represented by the bits in register eight by sixteen?

A.   sll $8, $0, 16
B.   sll $8, $8, 4
C.   sll $8, $8, 2
D.   sll 4, $8, $8

5.   Which of the following instructions has the effect of dividing the unsigned integer represented by the bits in register eight by sixteen?

A.   sll $8, $0, 16
B.   srl $8, $8, 4
C.   sll $8, $8, 2
D.   srl 4, $8, $8

6.   Write the assembly language statement that will reverse the values of each bit in register $5 and put the result in register $8.

A.   nori $8,$5,$0
B.   nor $8,$5,$0
C.   xor $8,$5,$0
D.   nor $5,$8,$0

7.   Write the assembly language statement that will reverse the values of each bit in register $7 and put the result in register $12.

A.   or $7,$0,$12
B.   nor $7,$7,$12
C.   not $7,$7,$12
D.   nor $12,$7,$0

8.   Write the assembly language statement that computes the bit-wise OR between $7 and $8 puts the result in register $9.

A.   or $9,$8,$7
B.   or $7,$8,$9
C.   or $0,$8,$7
D.   or $8,$9,$7

9.   Write the assembly language statement that computes the bit-wise XOR between $7 and $8 puts the result in register $9.

A.   xori $9,$8,0x7
B.   xor $7,$8,$9
C.   xor $9,$8,$7
D.   xor $8,$9,$7

10.   Write the assembly language instruction that copies the bit pattern in register $13 to register $15.

A.   ori $15,$13,$0
B.   or $15,$13,$0
C.   or $15,$13,$15
D.   xor $15,$13,$13


Click here