1 State what decimal values the following binary numbers rep
1. State what decimal values the following binary numbers represent if you interpret these binary numbers as either unsigned binary, signed magnitude, one’s complement, two’s complement, or excess-128 forms:
(a) 0101 1011 (c) 1000 0000 (e) 0000 0000 (g) 0000 0001
 (b) 1101 1001 (d) 1111 1111 (f) 1000 0001 (h) 0111 1111
2. Perform each of the following arithmetic operations by first converting the given decimal numbers into 8-bit two’s complement form. In each case, comment explicitly on whether you’ve detected overflow or not at the binary arithmetic level. (Show Calculations)
(a) 50 + 57 (b) 116 - 73 (c) -59 - 46 (d) -73 - 86 (e) –116 + 85 (f) 99 + 63
Solution
1.
 a) 0101 1011 [Represents a decimal value of 91 in unsigned binary, signed magnitude , 2s compement , 1s complement]
 b)1101 1001 [Represents a decimal value of 217 in unsigned binary and -89 in signed magnitude, -38 in 1s compelement , -39 in 2s complement]
 c) 1000 0000 [Represents a decimal value of 128 in unsigned binary and -0 in signed magnitude, -128 in 2s compelement, -127 in 1s complement ]
 d)1111 1111 [Represents a decimal value of 255 in unsigned binary and -127 in signed magnitude, -1 in 2s compelement, 0 in 1s complement ]
 e) 0000 0000 [Represents a decimal value of 0 in unsigned binary, signed magnitude , 255 in one\'s complement , 0 in 2s complement ]
 f) 1000 0001[Represents a decimal value of 129 in unsigned binary, -1 in signed magnitude , -126 in one\'s complement , -127 in 2s complement ]
 g) 0000 0001[Represents a decimal value of 1 in unsigned binary,signed magnitude , 1 in one\'s complement , 1 in 2s complement ]
 h) 0111 1111[Represents a decimal value of 127 in unsigned binary, 127 in signed magnitude , 127 in one\'s complement , 127 in 2s complement ]
 
 
 2. 50 + 57 =
 00110010
 00111001
 ---------------
 01101011 [No Overflow, Sum is correct (107)]
 ---------------
 
 b) 116 - 73
 116 = 01110100
 -73 = 10110111
 ==============
 1 00101011 [Carryout without Overflow, sum is correct]
 =========
 c)-59 = 11000101
 -46 = 11010010
 -----------------------
 1 10010111 [Carryout without Overflow, sum is correct ]
 =============
 d)-73 = 10110111
 -86 = 10101010
 -----------------------
 101100001 [Overflow with carry out, sum is not correct]
 =============
 e)-116 = 10001100
 85 = 01010101
 -----------------------
 11100001 [-31, No Overflow, Sum is correct]
 =============
 f) 99 = 01100011
 63 = 10100010
 -------------------------
 10100010 [-94 , Overflow no carry out , sum is not correct]
 ------------------------
 
 Why I wrote sum is not correct because..for 8 bits, 2s complement is range is -128 to 127 ., If the sum fallse outside the range..Then we get incorrect sum.


