Convert Decimal to Binary With 2's Complement
How can we convert the decimal fraction 0.188 to binary using the 2's complement method? How do we convert the decimal number 45 to binary? And how do we use 2's complement to find the answer to 15 - 18?
In order to convert the decimal fraction 0.188 to binary using the 2's complement method, we follow these steps: First, we multiply the given decimal by 2: 0.188 x 2 = 0.376 Next, we remove the whole number from the answer we got above and multiply the remaining decimal part by 2: 0.376 x 2 = 0.752 We repeat the step again, and our decimal becomes 1.504. We now ignore the whole number part and use the decimal part in the next multiplication: 0.504 x 2 = 1.008 We continue in this way, keep repeating until we get 0 as the decimal part: 0.008 x 2 = 0.016 0.016 x 2 = 0.032 0.032 x 2 = 0.064 0.064 x 2 = 0.128 0.128 x 2 = 0.256 0.256 x 2 = 0.512 0.512 x 2 = 1.024 Now we take the decimal parts of all the answers we got above, starting from top to bottom. Therefore, the binary representation of 0.188 is 0.00101101. To convert the decimal number 45 to binary, we use the division method: 45 ÷ 2 = 22 remainder 1 22 ÷ 2 = 11 remainder 0 11 ÷ 2 = 5 remainder 1 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 Therefore, the binary representation of 45 is 101101. To find the answer to 15 - 18 using 2's complement, we follow these steps: 15 in binary is 00001111. 18 in binary is 10010. To get the negative of 18, we invert the binary digits and add 1 to the result: 10010 --> 01101 --> 01101 + 1 = 01110. Now we add 01110 to 00001111: 00001111 + 01110 __________ 10001 Because there is an overflow, we discard the first digit to get the final answer. Therefore, 15 - 18 = -3.