Docsity

Midterm Exam 2 - Computer Architecture II: Hardware-Software Interface | CS 366, Exams of Computer Architecture and Organization

Toggle sidebar
bg1
CS 366 - Computer Architecture II, Midterm Exam #2, page 1 of 6
CS 366 - Computer Architecture II
Midterm Exam #2 - Prof. Reed
Fall 2003
What is your name?: ___________________________(0 points)
There are two sections:
I. Short Questions . . . . . . . . .20 points; (10 questions, 2 points each)
II. Short Sections of Code . . .80 points; (10 questions, 8 points each)
---------------
100 points total
This test is worth 20% of your final grade. This test is open book and open notes. You have 75 minutes.
I. True/False: (2 pts. each)
T F 1. There is at least one MIPS assembler instruction that can directly store a result of an ALU
calculation into memory.
T F 2. In addition to the 32 MIPS register file registers having mnemonic names such as $t3, the
registers can be referred to by their number, starting from $1 up to and including $32.
T F 3. Usage conventions for register use (what registers are used for what purposes) are strictly
enforced by the assembler.
T F 4. The value part (in this case 0xffff) of the instruction
li $t3, 0xffff
can actually be a 32-bit value.
T F 5. In the IEEE 754 single precision floating-point format, just like in mathematics, any number
to the 0th power is 1.
T F 6. Values for IEEE 754 single precision floating-point format numbers are unevenly distributed
between the largest and smallest possible values.
T F 7. Choosing a format to represent floating-point numbers involves a tradeoff between range of
values that can be represented, and precision of numbers that can be represented.
T F 8. Each state in an ASM diagram corresponds to one or more microprogram statements.
T F 9. Once an IR is implemented in a control unit design, the MDR is only used to write to mem-
ory, and all reading from memory is through the IR.
T F 10. The format of the IR limits the number of registers that can be used concurrently, however a
microprogram instruction could still write to all registers in a single instruction.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Midterm Exam 2 - Computer Architecture II: Hardware-Software Interface | CS 366 and more Exams Computer Architecture and Organization in PDF only on Docsity!

CS 366 - Computer Architecture II Midterm Exam #2 - Prof. Reed Fall 2003

What is your name?: ___________________________(0 points)

There are two sections: I. Short Questions........ .20 points; (10 questions, 2 points each) II. Short Sections of Code.. .80 points; (10 questions, 8 points each)


100 points total

This test is worth 20% of your final grade. This test is open book and open notes. You have 75 minutes.

I. True/False: (2 pts. each)

T F 1. There is at least one MIPS assembler instruction that can directly store a result of an ALU calculation into memory. T F 2. In addition to the 32 MIPS register file registers having mnemonic names such as $t3, the registers can be referred to by their number, starting from $1 up to and including $32. T F 3. Usage conventions for register use (what registers are used for what purposes) are strictly enforced by the assembler. T F 4. The value part (in this case 0xffff) of the instruction li $t3, 0xffff can actually be a 32-bit value. T F 5. In the IEEE 754 single precision floating-point format, just like in mathematics, any number to the 0th power is 1. T F 6. Values for IEEE 754 single precision floating-point format numbers are unevenly distributed between the largest and smallest possible values. T F 7. Choosing a format to represent floating-point numbers involves a tradeoff between range of values that can be represented, and precision of numbers that can be represented. T F 8. Each state in an ASM diagram corresponds to one or more microprogram statements. T F 9. Once an IR is implemented in a control unit design, the MDR is only used to write to mem- ory, and all reading from memory is through the IR. T F 10. The format of the IR limits the number of registers that can be used concurrently, however a microprogram instruction could still write to all registers in a single instruction.

III. Short Answer: (8 points each) Where there are multiple steps, please circle your final answer. You must show your work for credit.

1. Consider the following instruction: or $a1,$t2,$t Write this instruction in hexadecimal. 2. Consider the following value, using the IEEE 754 single precision floating-point format. What is the equivalent value as a decimal number? 0100 0011 0101 0100 0000 0000 0000 0000 3. Convert the following decimal value into a denormalized IEEE 754 single precision floating-point for- mat. Write your answer in hexadecimal. -0. 4. Consider the following value, using the IEEE 754 single precision floating-point format. What is the equivalent value as a decimal number? 0111 1111 1011 0100 0000 0000 0000 0000

8. Consider the microcode file given on the last page of this test.

a. (4 points) Rewrite the memory file program shown below using assembler-like sytnax (e.g. r2 <- r2 - r1 ). Write each assembler-like statement next to the corresponding line(s).

b. (4 points) What is the final value stored in register 0 after this memory file program is run? Please circle your answer. . Memory file % 0: 0 1: 000010 00

2: 2 3: 000010 01

4: 3 5: 000010 10

6: 1 7: 000010 11

8: 10 00 0110 9: 000011 00

10: 00 01 0000 11: 000001 00

12: 10 11 0000 13: 001010 10

14: 11111000 15: 000101 00

16: 0 17: 001011 00

9. Consider the microcode file given on the last page of this test.

a. (4 points) Rewrite the memory file program shown below using assembler-like sytnax (e.g. r2 <- r2 - r1 ). Write each assembler-like statement next to the corresponding line(s).

b. (4 points) What is the final value stored in register 0 after this memory file program is run? Please circle your answer.

10. Consider the microcode file given on the last page of this test. What does opcode 12 do?

Memory file % 0: 00001010 1: 00001000

2: 00000000 3: 00100100

CS 366 - Computer Architecture II Midterm Exam #2 - Prof. Reed Fall 2003

What is your name?: ___________________________(0 points)

There are two sections: I. Short Questions........ .20 points; (10 questions, 2 points each) II. Short Sections of Code.. .80 points; (10 questions, 8 points each)


100 points total

This test is worth 20% of your final grade. This test is open book and open notes. You have 75 minutes.

I. True/False: (2 pts. each)

T F 1. There is at least one MIPS assembler instruction that can directly store a result of an ALU calculation into memory. T F 2. In addition to the 32 MIPS register file registers having mnemonic names such as $t3, the registers can be referred to by their number, starting from $1 up to and including $32. T F 3. Usage conventions for register use (what registers are used for what purposes) are strictly enforced by the assembler. T F 4. The value part (in this case 0xffff) of the instruction li $t3, 0xffff can actually be a 32-bit value. T F 5. In the IEEE 754 single precision floating-point format, just like in mathematics, any number to the 0th power is 1. T F 6. Values for IEEE 754 single precision floating-point format numbers are unevenly distributed between the largest and smallest possible values. T F 7. Choosing a format to represent floating-point numbers involves a tradeoff between range of values that can be represented, and precision of numbers that can be represented. T F 8. Each state in an ASM diagram corresponds to one or more microprogram statements. T F 9. Once an IR is implemented in a control unit design, the MDR is only used to write to mem- ory, and all reading from memory is through the IR. T F 10. The format of the IR limits the number of registers that can be used concurrently, however a microprogram instruction could still write to all registers in a single instruction.

III. Short Answer: (8 points each) Where there are multiple steps, please circle your final answer. You must show your work for credit.

1. Consider the following instruction: or $a1,$t2,$t Write this instruction in hexadecimal. 2. Consider the following value, using the IEEE 754 single precision floating-point format. What is the equivalent value as a decimal number? 0100 0011 0101 0100 0000 0000 0000 0000 3. Convert the following decimal value into a denormalized IEEE 754 single precision floating-point for- mat. Write your answer in hexadecimal. -0. 4. Consider the following value, using the IEEE 754 single precision floating-point format. What is the equivalent value as a decimal number? 0111 1111 1011 0100 0000 0000 0000 0000

8. Consider the microcode file given on the last page of this test.

a. (4 points) Rewrite the memory file program shown below using assembler-like sytnax (e.g. r2 <- r2 - r1 ). Write each assembler-like statement next to the corresponding line(s).

b. (4 points) What is the final value stored in register 0 after this memory file program is run? Please circle your answer. . Memory file % 0: 0 1: 000010 00

2: 2 3: 000010 01

4: 3 5: 000010 10

6: 1 7: 000010 11

8: 10 00 0110 9: 000011 00

10: 00 01 0000 11: 000001 00

12: 10 11 0000 13: 001010 10

14: 11111000 15: 000101 00

16: 0 17: 001011 00

9. Consider the microcode file given on the last page of this test.

a. (4 points) Rewrite the memory file program shown below using assembler-like sytnax (e.g. r2 <- r2 - r1 ). Write each assembler-like statement next to the corresponding line(s).

b. (4 points) What is the final value stored in register 0 after this memory file program is run? Please circle your answer.

10. Consider the microcode file given on the last page of this test. What does opcode 12 do?

Memory file % 0: 00001010 1: 00001000

2: 00000000 3: 00100100