Binary to decimal.

  • #1
310
0

Homework Statement


Not so much a problem as a general wondering. I know how to convert from decimal to binary and binary to decimal apart from when there's a recurring pattern involved. One which I really can't figure out it 0.1001 (repeating). How do you go about converting that to decimal?


Homework Equations


None really.


The Attempt at a Solution


I really don't have any attempt as I can't find much about it on the internet. It features in a worked example in our notes and it's never explained. The answer is 0.6 apparently. (Not sure if this would be considered a computing problem or a mathematical one)
 

Answers and Replies

  • #2
34,687
6,393

Homework Statement


Not so much a problem as a general wondering. I know how to convert from decimal to binary and binary to decimal apart from when there's a recurring pattern involved. One which I really can't figure out it 0.1001 (repeating). How do you go about converting that to decimal?


Homework Equations


None really.


The Attempt at a Solution


I really don't have any attempt as I can't find much about it on the internet. It features in a worked example in our notes and it's never explained. The answer is 0.6 apparently. (Not sure if this would be considered a computing problem or a mathematical one)
The trick here is similar to what you do to convert a repeating decimal fraction to a rational number. For example, if you need to convert .35353535... to a fraction, you multiply by a power of 10 large enough to move the part that repeats to the other side of the decimal point, which in this case would be 102. If we write x = .353535..., then 100x = 35.353535...

Subtracting the equation with x from the equation with 100x, we get
99x = 35 ==> x = 35/99

For your binary fraction, write an equation x = .10011001...2. Get a new equation that you can subtract this one from by multiplying by 24 (or 16).
 
  • Like
Likes 1 person
  • #3
310
0
Won't you then end up with 15x = 1001, and that equals 66.733... and not 3/5 as it says in my notes. Is there a mistake in the notes or am I misunderstanding you?
 
  • #4
34,687
6,393
No, you won't. In my work I was careful to note that the fraction was in base-2 (something you neglected to do). You should have gotten 15x = 10012.

This is a bit ungainly, having a decimal number on one side, and a binary number on the other, but at least it's marked to indicate that different bases are being used.
 
  • Like
Likes 1 person
  • #5
310
0
Got it! Thanks a million.
 

Related Threads on Binary to decimal.

Replies
3
Views
3K
Replies
3
Views
7K
Replies
17
Views
19K
  • Last Post
Replies
8
Views
11K
  • Last Post
Replies
6
Views
566
  • Last Post
Replies
7
Views
2K
Replies
10
Views
7K
Replies
2
Views
2K
Replies
7
Views
1K
  • Last Post
Replies
7
Views
1K
Top