{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW1 answers - srl \$t0 \$t0 31 isolate sign for answer end 5...

This preview shows pages 1–2. Sign up to view the full content.

CSE/EEE 230 HW1 Answers 1. 3 points each 1. C1980000 a. 3247964160 b. -1047003136 c. -19 2. 40E06666 a. 1088448102 b. 1088448102 c. 7.0125 3. C0000000 a. 3221225472 b. -1073741824 c. -2.0 2. 3 point each a. 45454550514800 b. FFFFFF19 c. 40080000 d. 37D1B717 e. 00000000 f. C4606000 3. 10 points Subu \$t3, \$t5, \$t7 Slt \$t2, \$t5, \$t7 Add \$t2, \$t6, \$t2 Sub \$t2, \$t4, \$t2 4. 15 points srl \$t0, \$s0, 31 # isolate sign srl \$t1, \$s1, 31 # isolate sign beq \$t0, \$0, else # if => 0, go to next bne \$t2, \$0, else # if < 0, go to next ori \$t0, \$0, 1 # first was less j end # finished else: beq \$t1, \$t2, else2 # if signs match go to next and \$t0, \$0, \$0 # second was less j end # finished else2: sub \$t0, \$s0, \$s1 # subtract to find difference

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: srl \$t0, \$t0, 31 # isolate sign for answer end: 5. 30 points-7 = 11111001 10 = 00001010 a. Addition 11111001 00001010 00000011 b. Subtraction 11111001 00001010 11101111 c. 1010 11111001 00000000 0101 11110010 00000000 0010 11100100 11110010 0001 11001000 10111010 0000 10010000 10111010 d. 0000 10100000 00000111 0000 01010000 00000111 0000 00101000 00000111 0000 00010100 00000111 0000 00001010 00000111 0000 00000101 00000111 Answer is 0 r -7 Remember dividend = quotient * divisor + remainder-7 = 0 * 10 + -7 Note that division is done with 7 as a positive number....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

HW1 answers - srl \$t0 \$t0 31 isolate sign for answer end 5...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online