You are here:

Number Theory/Binary number confusion

Advertisement


Question
Hello Clyde,

Please, I am wondering how these numbers became their binary equivalent:

31.500 = 11111100
31.625 = 11111101

meanwhile, when I entered these binary numbers to see their decimal, I got  different values:
11111101 = 253
11111100 = 252

My question then is what is the correlation between 31.500 and 252 and 31.625 and 253?

Thanks

Answer
You are missing the decimal point:

31.500 = 11111.100
31.625 = 11111.101


The number "31.5" is not an integer, but you seemed to think it was equal to "11111100" which is an integer (no decimal point). That can't be true.

Binary digits correspond to powers of 2, so to convert 31.5 into binary, you find the power of 2 less than 31.5:

31.5 > 16 -> put a digit in the "16s place" (4th digit, since 16=2^4).

You have 15.5 left over, and the next biggest power is 8 = 2^3, so put 1 in the 3rd place.

This continues until you have 0.5 left. That is 2^(-1), so you put 1 in the place to the right of the decimal. You should obtain 11111.100

You can verify this representation as:

31.5 = 16 + 8 + 4 + 2 + 1 + 1/2
31.5 = 2^4 + 2^3 + 2^2 + 2 + 1 + 2^(-1)


If you repeat this with 31.625, this is only adding on 1/8th, so you get:

31.5 = 16 + 8 + 4 + 2 + 1 + 1/2 + 1/8
31.5 = 2^4 + 2^3 + 2^2 + 2 + 1 + 2^(-1) + 2^(-3)

which is represented in binary as 11111.101


If you move the decimal place, it's like multiplying by a power of 2 (just like in decimal numbers, where you multiply by powers of 10).

By omitting the decimal, you really moved it three spaces over, giving you 8 times the numbers you want. You can check that:

31.5 8 = 252
31.625 8 = 253

Number Theory

All Answers


Answers by Expert:


Ask Experts

Volunteer


Clyde Oliver

Expertise

I can answer all questions up to, and including, graduate level mathematics. I am more likely to prefer questions beyond the level of calculus. I can answer any questions, from basic elementary number theory like how to prove the first three digits of powers of 2 repeat (they do, with period 100, starting at 8), all the way to advanced mathematics like proving Egorov's theorem or finding phase transitions in random networks. I do not understand why Number Theory is not included in "Advanced Mathematics."

Experience

I am a PhD educated mathematician working in research at a major university.

Organizations
AMS

Publications
Various research journals of mathematics. Various talks & presentations (some short, some long), about either interesting classical material or about research work.

Education/Credentials
BA mathematics & physics, PhD mathematics from a top 20 US school.

Awards and Honors
Various honors related to grades, various fellowships & scholarships, awards for contributions to mathematics and education at my schools, etc.

Past/Present Clients
In the past, and as my career progresses, I have worked and continue to work as an educator and mentor to students of varying age levels, skill levels, and educational levels.

©2016 About.com. All rights reserved.