midterm3

# midterm3 - SYCS 201 Computer Organization Fall 2009 Midterm...

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

SYCS 201 Computer Organization Fall 2009 Midterm Exam Key (Total points: 100) (Please PRINT) Name: Howard ID: NOTE : Please show the details of your calculation and derivation, or no points will be given.

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

View Full Document
1 1. AE and 6F are the hexadecimal of two 8-bit two’s complement numbers. a. Sign-extend the two numbers to 16 bits. Show the result in hexadecimal. (4 pts) b. What are the corresponding decimal values? (4 pts) c. Subtract the second number from the first one. Is there an overflow? Show the calculation detail. (5 pts) d. Add the two numbers. Is there an overflow? Show the calculation detail. (5 pts) Key: a. AE 16 = 1010 1110 2 = 1111 1111 1010 1110 2 = FFAE 16 6F 16 = 0110 1111 2 = 0000 0000 0110 1111 2 = 006F 16 b. AE 16 = 1010 1110 2 The most significant bit is 1, therefore it represents a negative number. To get the absolute value, invert every bit and add one, we have 0101 0010 2 = 82 10 Therefore, AE 16 represents – 82 10 . 6F 16 = 0110 1111 2 The most significant bit is 0, therefore it represents a positive number. 0110 1111 2 = 111 10 Therefore, 6F 16 represents 111 10 . c. – 82 10 – 111 10 = – 82 10 + (– 111 10 ) In two’s complement, – 111 10 is represented by 1001 0001 2 (invert every bit of 0110 1111 2 and add 1). 1010 1110 + 1001 0001 ------------ 10011 1111
2 Since there are only 8 bits of storage, we have to discard the most significant bit in the sum and have 0011 1111 which represents a positive number. On the other hand, the result of subtracting a positive number from a negative number must be negative. Therefore there is an overflow. d. 1010 1110 + 0110 1111 ------------ 10001 1101 Adding two numbers of opposite signs won’t result in overflow in any case.

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

View Full Document
3 2. Provide the binary representation of the decimal number 201.90625 in the IEEE 754 single precision format. (12 pts) Key: 201 / 2 = 100 201 % 2 = 1 100 / 2 = 50 100 % 2 = 0
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 10

midterm3 - SYCS 201 Computer Organization Fall 2009 Midterm...

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

View Full Document
Ask a homework question - tutors are online