Reading 1: Binary Fractions

Small numbers with big binary energy

Binary Fractions

In Topic 1b we considered how a binary bit string like 010111002 could be translated to an unsigned integer. Based on the material in Topic 1b we would translate this string to be the decimal value 92 (64+16+8+4).

But how do we extend binary notation to accommodate fractional values?

To do this, computers use a radix point (aka binary point) in the same role as the decimal point in base‑10 notation. The digits to the left of the radix represent the integer part while the digits to the right of the radix represent the fractional part. Their place values continue the same pattern of powers of two — but now using negative exponents.

Position 2⁰ 2⁻¹ 2⁻² 2⁻³ 2⁻⁴
Value 8 4 2 1 1/2 1/4 1/8 1/16

Notice this is simply a continuation of the rule you already know: Each position is worth twice as much as the one to its right. Or the other way of looking at it — especially helpful to the right of the radix point — each position is half of the value to its left.

Note: In reality, computers do something related to the table above, but much more involved. We don't think it is necessary for you to understand that more involved process — just that it exists. So for this topic (and this course) we will consider this simplified encoding based on 4 bits for the integer and 4 bits for the fraction.  If you want to learn more about what computers actually do, check out the "Extend Your Learning" reading about Floating Point/IEEE 754 back on the main topic page.

Example: Decoding a Fraction

Before we look at a full example, let's start with a simple warm-up. Consider the bit string 0001.10002. The integer part is 0001 = 1, and the fractional part is 1000 — only the 1/2 bit is set, so the fractional part is 0.5. Thus 0001.10002 = 1.5. Just one integer bit and one fractional bit turned on — easy to verify.

Now let's consider what it means to decode the bit string 010111002 using the simplified encoding we just presented. If we consider a place value table like we were working with in Topic 1b we might write:

2⁰
2⁻¹
2⁻²
2⁻³
2⁻⁴
8
4
2
1
1/2
1/4
1/8
1/16
0
1
0
1
1
1
0
0

Integer part:

Recall that for this simplified encoding we are going to take the first 4 bits and treat that as the integer portion. The first 4 bits are 01012.

Total: 5

Fractional part:

The second 4 bits are treated as the fractional portion. The second 4 bits are 11002.

Total: 1/2 + 1/4 = 3/4

Thus: 0101.11002 = 5 + 3/4 = 5.75

Check: 4 + 1 + 1/2 + 1/4 = 5.75 ✓

Now You Try

Convert the 8‑bit string 101101102 to its decimal/fractional equivalent, using the first 4 bits as the integer and the last 4 bits as the fraction.

Show answer

Integer part (first 4 bits: 1011):

  • 1 × 8 = 8
  • 0 × 4 = 0
  • 1 × 2 = 2
  • 1 × 1 = 1

Integer total: 11

Fractional part (last 4 bits: 0110):

  • 0 × 1/2 = 0
  • 1 × 1/4 = 1/4
  • 1 × 1/8 = 1/8
  • 0 × 1/16 = 0

Fractional total: 1/4 + 1/8 = 3/8 = 0.375

101101102 = 11.375

Check: 8 + 2 + 1 + 0.25 + 0.125 = 11.375 ✓