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


QUIZ on Chapter 16

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 the smallest addressable unit of main memory?

A.   bit
B.   halfword
C.   nibble
D.   byte

2.   Which of the following instructions does sign extension?

A.   lbu
B.   lb
C.   sb
D.   lhu

3.   What instruction is used to store a byte to memory?

A.   sb
B.   sbu
C.   lb
D.   lbu

4.   Which one of the following address are half-word aligned?

A.   0x01004F35
B.   0x01004F37
C.   0x01004F3A
D.   0x01004F3F

5.   Which of the following assembler directives reserves twelve bytes of memory?

A.   .word 3
B.   .byte 12
C.   .block 6
D.   .space 12

6.   You wish to speed up the execution of a C program. The program runs on a 32-bit processor. You notice that the variables in the program are a mix of short int, int and long int variables. The program does a great deal of integer arithmetic. How might you speed up this program?

A.   Make as many variables of type int as is possible.
B.   Make as many variables of type short int as is possible.
C.   Make all variables as small as is needed for the range of values they are expected to hold.
D.   Shorten the names of all the variables.

7.   A digital image is stored in a file. The pixels of the image represent a gray level of 0 to 255. What instruction are you likely to use in loading a register with the value of a pixel?

A.   lb
B.   lbu
C.   lw
D.   lwu

8.   How does SPIM display the data section of simulated main memory?

A.   One byte per address in columns.
B.   In groups of 4-byte words with the highest address of each word on the right.
C.   In groups of 4-byte words with the lowest address of each word on the right.
D.   This depends on the type of data in memory.

9.   Which of the following instructions does zero extension?

A.   lbu
B.   lb
C.   sb
D.   lh

10.   Will the low-order byte of the result of several 32-bit arithmetic operations always be the same as the result of the same operations performed with 8 bits?

A.   No. The result will always be totally different.
B.   No. Sometimes the result will be the same, but not in general.
C.   Yes, if the final answer fits in 8 bits the results will be the same.
D.   Yes, always.


Click here