66.9k views
4 votes
Convert to binary:
a. 156
b. 12.34375

User Monksp
by
8.3k points

1 Answer

2 votes

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.

User Dqureshiumar
by
8.8k points

Related questions

asked Sep 12, 2024 135k views
IRHM asked Sep 12, 2024
by IRHM
7.4k points
1 answer
3 votes
135k views
asked Mar 2, 2024 188k views
Jszumski asked Mar 2, 2024
by Jszumski
8.1k points
2 answers
2 votes
188k views
asked May 3, 2020 205k views
Johannes Ferner asked May 3, 2020
by Johannes Ferner
8.2k points
2 answers
1 vote
205k views