Question: 1. What will be printed in the second line? Why? a. -32769, because y will be pre-decremented before printing b. -32768, because -32768 is the
1. What will be printed in the second line? Why?
a. -32769, because y will be pre-decremented before printing
b. -32768, because -32768 is the smallest possible number in 2-byte 2s compliment representation. B cannot be decremented
c. 32767, because -32768 is the smallest possible number in 2-byte 2s compliment representation. --B will overflow to the largest possible number.
d. -1, because -32768 is the smallest possible number in 2-byte 2s compliment representation.
--B will overflow to the largest possible negative number.
2. Which of the following operations will overflow in 4-bit twos compliment representation?
a. 1111 + 1111
b. 0111 + 0001
c. 1000 1111
d. 0111 + 1111
BONUS (5 * 4 points)
3. What is AA BA in 8-bit unsigned representation? [all numbers are given in hex]
a. Overflow
b. 10
c. 1A
d. A1
4. What is the 8-bit 2s complement representation of a number which is represented as 8116 in 8-bit sign-magnitude integer representation?
FF16
1816
1116
Cannot be determined
5. What is 3B16 + AB16 in 8-bit sign-magnitude representation?
DB16
1016
2B16
Cannot be determined
6. What is 1100 0001 in 4-bit 2s compliment representation?
a. 11011 overflow
b. 1011 = - 5
c. 1100 = -4
d. 1101 = -3
7. Overflow will occur when adding two in 2s compliment, if
a. the signs of the operands are different
b. there is a carry-out from the MSBs
c. the signs of the operands are same, and there is a carry-out from the MSBs
d. the signs of the operands are same, but the sign of the result is different
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
