In: Computer Science
Please convert decimal value -32760 into 2's complement binary value
This is negative. so, follow these steps to convert this into a 2's complement binary Step 1: Divide 32760 successively by 2 until the quotient is 0 32760/2 = 16380, remainder is 0 16380/2 = 8190, remainder is 0 8190/2 = 4095, remainder is 0 4095/2 = 2047, remainder is 1 2047/2 = 1023, remainder is 1 1023/2 = 511, remainder is 1 511/2 = 255, remainder is 1 255/2 = 127, remainder is 1 127/2 = 63, remainder is 1 63/2 = 31, remainder is 1 31/2 = 15, remainder is 1 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 111111111111000 Adding 1 zeros on left hand side of this number to make this of length 16 So, 32760 in normal binary is 0111111111111000 Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0. 0111111111111000 is flipped to 1000000000000111 Step 3:. Add 1 to above result 1000000000000111 + 1 = 1000000000001000 so, -32760 in 2's complement binary is 1000000000001000 Answer: 1000000000001000