Final answer:
To convert a decimal number to binary, divide the number by 2 and keep track of the remainders. The binary representation is obtained by writing the remainders in reverse order. To convert a fraction to binary, multiply it by 2 and keep track of the whole number parts. The binary representation is obtained by concatenating the whole number parts.
Step-by-step explanation:
To convert a decimal number to binary, we need to divide the number by 2 and keep track of the remainders. We continue dividing the quotient by 2 until the quotient becomes 0. The binary representation is obtained by writing the remainders in reverse order.
a. 156 ÷ 2 = 78 with a remainder of 0, 78 ÷ 2 = 39 with a remainder of 0, 39 ÷ 2 = 19 with a remainder of 1, 19 ÷ 2 = 9 with a remainder of 1, 9 ÷ 2 = 4 with a remainder of 1, 4 ÷ 2 = 2 with a remainder of 0, 2 ÷ 2 = 1 with a remainder of 0, 1 ÷ 2 = 0 with a remainder of 1. The binary representation of 156 is 10011100.
b. To convert a fraction to binary, we can multiply it by 2 and keep track of the whole number part. We continue multiplying the fractional part until it becomes 0 or until we reach the desired precision. The binary representation is obtained by concatenating the whole number parts.