In: Computer Science
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127.
Please be careful and explain all the steps and details.
-44 ------ This is negative. so, follow these steps to convert this to various binary formats. Divide 44 successively by 2 until the quotient is 0 > 44/2 = 22, remainder is 0 > 22/2 = 11, remainder is 0 > 11/2 = 5, remainder is 1 > 5/2 = 2, remainder is 1 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 101100 So, 44 of decimal is 101100 in binary Adding 2 zeros on left hand side of this number to make this of length 8 So, 44 in normal binary format is 00101100 sign-magnitude: ----------------- set 1 as left most bit, since this number is negative. so, 00101100 becomes 10101100 ===================================== || sign-magnitude: 10101100 || ===================================== 1's complement: ----------------- flip all the bits. Flip all 0's to 1 and all 1's to 0. 00101100 is flipped to 11010011 ===================================== || 1's complement: 11010011 || ===================================== 2's complement: ----------------- Add 1 to above result 11010011 + 1 = 11010100 ===================================== || 2's complement: 11010100 || ===================================== for excess-127: --------------- for binary value add 127 to -44 127-44 = 83 Divide 83 successively by 2 until the quotient is 0 > 83/2 = 41, remainder is 1 > 41/2 = 20, remainder is 1 > 20/2 = 10, remainder is 0 > 10/2 = 5, remainder is 0 > 5/2 = 2, remainder is 1 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 1010011 So, 83 of decimal is 1010011 in binary ================================= || excess-127: 01010011 || =================================