You are not logged in.
Pages: 1
How do you convert, let's say 6.47 (base-10), into both binary and ternary system?
Offline
In base 10, you have thousands, hundreds, tens and units. But this continues after the decimal point and you have tenths, hundredths and so on.
Similarly, base 2 has eights, fours, twos, units, but then it continues with halves, quarters, etc.
To convert a number from base 10 to base 2, write it in terms of powers of two.
eg.
3.25 = 2 + 1 + 1/4, so 3.25 (base 10) = 11.01 (base 2)
One important point: in the same way that you can get endless decimals in base 10 (1/3 = 0.333...), you might get some endless decimals when converting between bases.
So for 6.47, you'd try to write it in powers of 2:
4
4+2 = 6
6+1/4 = 6.25
6.25 + 1/8 = 6.375
6.375 + 1/16 = 6.4375
6.4375 + 1/32 = 6.46875
...
You can get very close to what you're trying to convert, but it will take an infinite amount of fractions to actually get there, so the base 2 decimal form will have to be non-terminating.
I'd say your best plan is to round it. To five decimal places, 6.47 (base 10) = 110.01111 (base 2).
Base 3 conversion is very similar. Write the original number in terms of nines, threes, ones, thirds, ninths and so on, then write the base 3 form using that.
Last edited by mathsyperson (2009-01-03 10:08:10)
Why did the vector cross the road?
It wanted to be normal.
Offline
4
4+2 = 6
6+1/4 = 6.25
6.25 + 1/8 = 6.375
6.25 + 1/16 = 6.4375
6.25 + 1/32 = 6.46875
...
Arent you missing some terms?
Offline
Aah, sorry. Edited now.
I knew what I was doing, I just didn't type it.
Why did the vector cross the road?
It wanted to be normal.
Offline
Unfortunately I couldnt get
. I gotbut I couldnt do the division.
Offline
This way works:
So now we can convert fractions into base 2 if some multiple of their denominator is one less than a power of 2.
Edit: In fact, by also using Jane's method for 1/6, we can convert a fraction if it can be written as
I'm fairly sure all fractions can do this (based on the fact that they can if the 2's are replaced by 10's).
Why did the vector cross the road?
It wanted to be normal.
Offline
This can't be legal multiplication?
Last edited by courteous (2009-01-05 08:28:27)
Offline
No, that bit's fine. You can see why if you think of it terms of the fractions:
0.1 x 0.010101...
0.0010101...
Why did the vector cross the road?
It wanted to be normal.
Offline
Pages: 1