In: Computer Science
Binary
How is 00001001 (base 2) represented in 8-bit two’s complement notation?
Convert 0.3828125 to binary with 4 bits to the right of the binary
point.
How is 00110100 (base 2) represented in 8-bit one's
complement.
1) flip all the bits. Flip all 0's to 1 and all 1's to 0. 00001001 is flipped to 11110110 Add 1 to above result 11110110 + 1 = 11110111 Answer: 11110111 2) Converting 0.3828125 to binary Convert decimal part first, then the fractional part > First convert 0 to binary Divide 0 successively by 2 until the quotient is 0 Read remainders from the bottom to top as So, 0 of decimal is in binary > Now, Convert 0.38281250 to binary > Multiply 0.38281250 with 2. Since 0.76562500 is < 1. then add 0 to result > Multiply 0.76562500 with 2. Since 1.53125000 is >= 1. then add 1 to result > Multiply 0.53125000 with 2. Since 1.06250000 is >= 1. then add 1 to result > Multiply 0.06250000 with 2. Since 0.12500000 is < 1. then add 0 to result > Multiply 0.12500000 with 2. Since 0.25000000 is < 1. then add 0 to result > Multiply 0.25000000 with 2. Since 0.50000000 is < 1. then add 0 to result > Multiply 0.50000000 with 2. Since 1.00000000 is >= 1. then add 1 to result > This is equal to 1, so, stop calculating 0.3828125 of decimal is 0.0110001 in binary so, 0.3828125 in binary is 0.0110001 if you need only 4 bits, answer is 0.0110 Answer: 0.0110 3) flip all the bits. Flip all 0's to 1 and all 1's to 0. 00110100 is flipped to 11001011 Answer: 11001011