=========================preview======================
(COMP180)cs180-quiz2-spring04-sol.pdf
Back to COMP180 Login to download
======================================================
COMP180: Computer Organization (Spring 2004)

Quiz #2
26 April 2004

Name:________Solution___________
StudentID:________________________

E-mail: __________________________
Section: L_________________________




This is a closed notes, closed book quiz.
Answer all questions in the spaces provided. Time allowed: 45 minutes

Question 1: Integer Division (Final version) (25 marks)



Flow chart of the final version of the division algorithm.
Based on the algorithm as shown on page 1, complete 00110100(two) / 0101(two) by filling in the following table. [25 marks]



Divisor register (4 bits)
Remainder register (8 bits)

Initialization

0101 (2 mark for correctness)
00110100 (2 mark )

Complete iteration 1

0101 (2 mark for repeating)
00110001 (3 mark each)

Complete iteration 2

0101
01100010

Complete iteration 3

0101
00100101

Complete iteration 4

0101
01001010

Division done

0101
00101010






What are the values of quotient and remainder registers after the division is completed?

Quotient (4 bits, binary) = ______1010 (2 marks)__________ 1010 (2 marks)

Remainder (4 bits, binary) = ____0010 (2 marks)____________ 0010 (2 marks)

Remarks:
1. Alternative answer: 0110 1000 is also correct in initialization.

2. If student present all the steps in one box, the best answer will be chosen (hidden to student).


Question 2: Floating point number representation and arithmetic operations in MIPS architecture (39 marks)

a)
What is the floating point standard adopted in MIPS architecture, as stated in the lecture notes? [3 marks]




Answer: IEEE 754 Floating-Point Standard or equivalent mathematical expression

b)
Assume that the single precision representation of the floating point standard in (2a) is used. Fill in the missing entries in the table below: [27 marks]




Decimal Representation
Single Precision Floating Point Representation (binary)

Sign
Exponent
Significand

28/16 = 1.75

0
01111111
11000000000000000000000

1/3

0
01111101
01010101010101010101010 or
01010101010101010101011

24

0
10000011
00000000000000000000000

1.625*2-126 or
2-126 + 2-127 + 2-129 or
1.910178*10-38
0
0000 0001
1010 0000 0000 0000 0000 000


0.625*2-126 or
2-127 + 2-129
7.346840*10-39
0
0000 0000
1010 0000 0000 0000 0000 000


-infinity
1
1111 1111
0000 0000 0000 0000 0000 000


1
0
0111 1111
0000 0000 0000 0000 0000 000




Part b) i) sign 1pt@ , exponent 2pt@ , significand 2pt@
ii) -1pt@ if significand has 24 bits
iii) correctly filled in the numbers in the 1st column 3pt@

c)
Assume that the single precision representation of the floating point standard in (2a) is used. Compute the answers of the following expressions based on the floating poin