# Binary help!

1. Sep 8, 2008

### goaliejoe35

The problem statement, all variables and given/known data
Calculate the binary equivalent of 2/3 out to eight places. Then convert from binary to decimal. How close is the result to 2/3?

The attempt at a solution

I new to this and I am still trying to figure this stuff out so if someone could walk me through this that would be great! Here's what I came up with from some stuff I read.....

2/3 * 2 = 1+1/3 X1=1
1/3 * 2 = 0+2/3 X2=0
.......and so on.....

I did that out to 8 places and got the number 10101010 and i suppose that that is actually 0.10101010 since 2/3 is .66666667?

Is this correct and if so how do I convert to decimal?

2. Sep 8, 2008

### mgb_phys

Fractions in binary are stored as sum's of negative powers of two.
So write the headings, 1/2 1/4 1/8 1/16 1/32 ......
Convert the decimal to binary in almost the same way as you would for a whole number.
eg 0.66666666 -0.5 = 0.16 , so a 1 in the half column
0.16 is less than 0.25 so a 0 in the quarter column
0.16 - 0.125 = 0.035 so a 1 in the 1/8 column

etc.

If you do it this way, you have the remainder automatically as you work out thebinary.

3. Sep 8, 2008

### goaliejoe35

I don't understand why your subtracting?

4. Sep 8, 2008

### chroot

Staff Emeritus
Each time you put down a 1 (representing a value of 1/2 or 1/4 of 1/8, etc.), you have less and less remainder left.

- Warren