In: Computer Science
Represent -60 in binary using 8-bit signed magnitude.
Add the following unsigned 8 bit binary numbers as shown. 01110101 + 00111011
Add the following unsigned 8 bit binary numbers as shown. 01000100 + 10111011
1) -60 ------ This is negative. so, follow these steps to convert this to various binary formats. Divide 60 successively by 2 until the quotient is 0 60/2 = 30, remainder is 0 30/2 = 15, remainder is 0 15/2 = 7, remainder is 1 7/2 = 3, remainder is 1 3/2 = 1, remainder is 1 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 111100 Adding 2 zeros on left hand side of this number to make this of length 8 So, 60 in normal binary format is 00111100 sign-magnitude: ----------------- set 1 as left most bit, since this number is negative. so, 00111100 becomes 10111100 ===================================== || sign-magnitude: 10111100 || ===================================== 2) Adding 01110101 and 00111011 in binary 01110101 00111011 ------------- 10110000 ------------- so, 01110101 + 00111011 is 10110000 3) Adding 01000100 and 10111011 in binary 01000100 10111011 ------------- 11111111 ------------- so, 01000100 + 10111011 is 11111111