Binary numbers with a fractional part
After the point the digits have weights 1/2, 1/4, 1/8 and so on. Convert the fractional part by repeated doubling.
Rules
- Integer part as usual
- Double the fraction, note the digit before the point
- Read from top to bottom
- Not every decimal is finite in binary (0.1)
Your turn
Three problems on this topic. Spaces don’t matter.
- 1 · Fixed point
- 2
- 3
Write the number in binary with a fractional part.
28.3125
Binary (with a point)
Worked example
What decimal value does the fixed-point number have?
1111.0011
Worked solution
- 1Integer part: 15 = 1111
- 2Fractional part, keep doubling:
- 30.1875 · 2 = 0.375 → 0
- 40.375 · 2 = 0.75 → 0
- 50.75 · 2 = 1.5 → 1
- 60.5 · 2 = 1 → 1
- 7= 1111.0011
Typical mistake: Fractional bits are read from top to bottom, unlike with division.
Common questions
Why is 0.1 inexact on a computer?
In binary 0.1 is periodic and has to be rounded.
