Created 03/14/03

# on Bitwise Logic

This is a practice quiz. The results are not recorded anywhere and do not affect your grade. The questions on this quiz might not appear in any quiz or test that does count toward your grade.

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 in the box after each question.

1. Some machine instructions hold one of the operands for the operation. What is such an operand called?

A. immediate operand
B. embedded operand
C. binary operand
D. machine operand

2. What is it called when a logical operation is performed between the bits of each column of the operands to produce a result bit for each column?

A. logic operation
B. bitwise operation
C. binary operation
D. column

3. When an operation is actually performed, what is true of the operands in the ALU?

A. At least one operand must be 32 bits wide.
B. Each operand can be any size.
C. Both operands must come from registers.
D. They must each be 32 bits wide.

4. Sixteen bits of data from an `ori` instruction are used as an immediate operand. During execution, what must first be done?

A. The data is zero extended by 16 bits on the right.
B. The data is zero extended by 16 bits on the left.
C. Nothing needs to be done.
D. Only 16 bits are used from the other operand.

5. What is it called with a bit pattern is copied into a register?

A. The register is loaded with the pattern.
B. The register is stuffed with the pattern.
C. The register is filled with the pattern.
D. The register is set with the pattern.

6. Which of the following instructions loads register `$5` with the bit pattern that represents positive 48?

A. `ori $5,$0,0x48`
B. `ori $5,$5,0x48`
C. `ori $5,$0,48`
D. `ori $0,$5,0x48`

7. Can the `ori` instruction put the two's complement representation of a negative integer into a register?

A. No.
B. Yes.

8. Which of the following instructions clears all the bits in register $8 except for the low order byte, which is unchanged?

A. `ori $8,$8,0xFF`
B. `ori $8,$0,0x00FF`
C. `xori $8,$8,0xFF`
D. `andi $8,$8,0xFF`

9. What is the result of performing an exclusive or of a bit pattern with itself?

A. The result is all zero bits.
B. The result is the same as the original.
C. The result is all one bits.
D. The result is the reverse of the original.

10. Do all machine instructions have the same parts?

A. No. Different types of machine instructions are made of different fields.
B. No. Each machine instruction is completely different from any other.
C. Yes. All machine instructions have the same parts in the same order.
D. Yes. All machine instructions have the same parts, but they might be in different orders.

The number you got right: Percent Correct: Letter Grade:

If you have returned here from another page, or have re-loaded this page, you will need to click again on each of your choices for the grading program to work correctly. You may want to press the SHIFT KEY while clicking to clear the old answers.