=========================preview======================
(COMP180)2006_s_midterm.pdf
Back to COMP180 Login to download
======================================================
COMP 180 Computer Organization
Spring Semester 2006
Midterm Examination

Date: April 03, 2006 (Monday) Time: 7:00 pm C 9:00 pm (2 hours)
Name: __________________________________ Student ID: _______________________
Email: __________________________________ Class ID: _________________________

Instructions:
1.
Please write your name, student ID, class ID, and email address on this page. Read the following instructions carefully.

2.
This is a CLOSED book exam!

3.
This examination paper consists of 4 questions and 9 pages (including this page).

4.
You have 120 minutes to complete this exam.

5.
Answer all questions within the space provided on the examination paper. You may use back of the pages for your rough work. Be concise! This is NOT an essay contest.

6.
Please read each question very carefully and answer the question clearly to the point. Make sure that your answers are neatly written, legible, and readable.

7.
Show all the steps used in deriving your answer, wherever appropriate.


Question Points Score
1 25
2 25
3 20
4 30
Total 100

1. (25 points) Computer Arithmetic
a) Show all the steps to convert the decimal number, -17.1875 2-129, to a single-precision floating point number. The final result should be filled into the grids below; the leftmost and rightmost grids are for bit 31 and 0, respectively. Note: no point for empty grids. (4 pts)
31 0
b) Let multiplicand and multiplier be -5 and 7 respectively. The lengths of the operands are assumed to be 4 bits. Show how the multiplication can be done using the Booth's algorithm. You are required to fill in the Product column. The Remark column is for your rough work and will not be graded. (5 pts)
Iteration Multiplicand Product (P) Remark
0
1

2 1101

3

4

COMP 180 (Spring 2006) Midterm Examination Page 2/9


c) Shows how to route the wires from one level to another in the figure below to implement an 8-bit logical left shifter. The operand to be shifted is in A, while the shift amount is in B. Lastly; fill in the truth table for the boxes used in the figure. (8 pts)


X Y B
Z

0 0 0 0 0 0 1 00 1 0 10 1 1 01 0 0 0 1 0 1 11 1 0 11 1 1 1








d) Give the Boolean equations for both Sum and Carryout for the 1-bit full adder below. (8 pts)

ab+ac+bc
Carryout =

2. (25 points) Instruction Set Architecture
a) Produce a minimal sequence of actual MIPS instructions to accomplish pseudoinstructions in the following, you may use the register $at for some of the sequences. (3 pts each)
slt $t0,$t3,$t5bne $t0,$zero,L
i) ble $t3, $t5, L # if ($t3 < $t5) go to L
xori $t2,$t3,0
ii) not $t2, $t3 # $