Converting Binary to Decimal: Calculating 2/3

  • Thread starter Thread starter goaliejoe35
  • Start date Start date
  • Tags Tags
    Binary
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 12K views
goaliejoe35
Messages
72
Reaction score
0
Homework Statement
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?
 
Physics news on Phys.org
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.
 
I don't understand why your subtracting?