Final answer:
To convert a decimal number to binary, you need to divide the number by 2 repeatedly and record the remainder. The remainders, read from bottom to top, will give you the binary representation of the number.
Step-by-step explanation:
To convert a decimal number to binary, you need to divide the number by 2 repeatedly and record the remainder. The remainders, read from bottom to top, will give you the binary representation of the number.
a. To convert 156 to binary:
- 156 ÷ 2 = 78, remainder 0
- 78 ÷ 2 = 39, remainder 0
- 39 ÷ 2 = 19, remainder 1
- 19 ÷ 2 = 9, remainder 1
- 9 ÷ 2 = 4, remainder 1
- 4 ÷ 2 = 2, remainder 0
- 2 ÷ 2 = 1, remainder 0
- 1 ÷ 2 = 0, remainder 1
So, 156 in binary is 10011100.
b. To convert 12.34375 to binary:
- 12 ÷ 2 = 6, remainder 0
- 6 ÷ 2 = 3, remainder 0
- 3 ÷ 2 = 1, remainder 1
- 1 ÷ 2 = 0, remainder 1
The integer part becomes 1100 in binary. For the fractional part, you multiply it by 2 repeatedly and record the integer part. The integer parts, read from top to bottom, will give you the binary representation of the fractional part.
0.34375 × 2 = 0.6875 (integer part: 0)
0.6875 × 2 = 1.375 (integer part: 1)
0.375 × 2 = 0.75 (integer part: 0)
0.75 × 2 = 1.5 (integer part: 1)
0.5 × 2 = 1 (integer part: 1)
So, 0.34375 in binary is 0.01011.