In: Computer Science
Show ALL work if it is required for the question and BASES
1. What is the Binary representation of this Decimal? (signed) 115
2. What is the Hexadecimal representation of this Decimal? (signed) 220
3. Convert the following from Signed Decimal to Hexadecimal: (signed) -24
1) 115 Since this is a positive number. we can directly convert this into binary Divide 115 successively by 2 until the quotient is 0 > 115/2 = 57, remainder is 1 > 57/2 = 28, remainder is 1 > 28/2 = 14, remainder is 0 > 14/2 = 7, remainder is 0 > 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 1110011 So, 115 of decimal is 1110011 in binary so, 115 in 2's complement binary is 01110011 Answer: 01110011 2) Divide 220 successively by 16 until the quotient is 0 220/16 = 13, remainder is 12 13/16 = 0, remainder is 13 Read remainders from the bottom to top as DC Answer: 0xDC 3) -24 This is negative. so, follow these steps to convert this into a 2's complement binary Step 1: Divide 24 successively by 2 until the quotient is 0 > 24/2 = 12, remainder is 0 > 12/2 = 6, remainder is 0 > 6/2 = 3, remainder is 0 > 3/2 = 1, remainder is 1 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 11000 So, 24 of decimal is 11000 in binary So, 24 in normal binary is 00011000 Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0. 00011000 is flipped to 11100111 Step 3:. Add 1 to above result 11100111 + 1 = 11101000 so, -24 in 2's complement binary is 11101000 Now convert 11101000 to hexadecimal Converting 11101000 to hexadecimal 1110 => E 1000 => 8 So, in hexadecimal 11101000 is 0xE8 Answer: 0xE8