Anda di halaman 1dari 7

ECE 452: Computer Organization and Design

Spring 2010

Homework 3: MIPS Assembly Programming and Computer


Arithmetic
Assigned: 16 Feb 2010
Due: 23 Feb 2010
Instructions:

Please submit your assignment solutions in class on the due date. Assembly program code for Q.1-3
should be submitted via RamCT and will be evaluated on the MARS simulator for correctness.
Some questions might not have a clearly correct or wrong answer. In such cases, grading is based on your
arguments and reasoning for arriving at a solution.
Exercises are from the 4th edition of Computer Organization and Design by D. Patterson and J.
Hennessey

Use the MARS simulator to write and test programs in questions 1, 2, and 3.
Q1 (25 points) Exercise B.6 (see program zip file)
Q2 (30 points) Exercise B.8 (see program zip file)
Q3 (50 points) Exercise B.9 (see program zip file)
Q4 (55 points) Exercise 3.10

73 127 = -54

Mantissa = 1 .01001100000000000000100
Decimal value = 1.2968755
2-54
Ans = 1.2968755 x 2-54
95 127 = -32

Mantissa = 1 .01111110000000000000000 ; Decimal value = 1.4921875


-32
Ans = 1.4921875 x 2-32 2

127 + 10 = 137

Ans = 0 10001001 10010010011000000000000

127 + 9 = 136

Ans = 1 10001000 11010101011010000000000

1023 + 10 = 1033

Ans = 0 10000001001 1001001001100000000000000000000000000000000000000000

1023 + 9 = 1032

Ans = 1 10000001000 1101010101101000000000000000000000000000000000000000

Q5 (90 points) Exercise 3.14 (except 3.14.6)

Anda mungkin juga menyukai