Fixed Point: Taming Those Tricky Fractions!

So, you thought binary was just for whole numbers, did you? Wrong! It turns out computers can also get their digital teeth into fractions – those bits of numbers that aren't quite whole. This is where something called fixed point binary comes into play. It's a way of drawing a line in the digital sand (or rather, a point in the binary string) to separate the whole number part from the fractional bit. Clever, eh?

Think of it like this: you've got your usual binary numbers marching along, and then, suddenly, there's a binary point. Everything to the left of that point is the normal whole number bit. But everything to the right? That's where the fractions live. The first digit after the point represents 2-1 (which is a half in our regular numbers), the next one is 2-2 (a quarter), then 2-3 (an eighth), and so on, getting smaller and smaller as you go further to the right. It's like a digital shrinking ray for fractions!

Fixed Point to Denary: Decoding the Fractional Fun

Now, if you've got a fixed point binary number and you want to know what it means in our regular denary (or decimal) system, there's a little process to follow. They've even given us a handy way to organise it: a table! Let's have a squint at that:

× 23× 22× 21× 20.× 2-1× 2-2

See how that point separates the powers of 2? On the left, you've got the usual positive powers (like 20 which is 1, 21 which is 2, and so on). But on the right, after the dot, the powers become negative. That 2-1 is like saying ½, and 2-2 is like 1/22 = ¼, and so on. It's all about those inverse powers!

Worked Examples Icon Worked examples

Convert the fixed point number 101.11 to denary.

Step 1 and Step 2: write the bits in a table and calculate each multiplication (see table).

101.11
× 22× 21× 20.× 2-1× 2-2
401.0.50.25

Step 3: add the results. Answer: 4 + 0 + 1 + 0.5 + 0.25 = 5.75

Denary to Fixed Point: Wrangling Whole Numbers and Naughty Fractions!

So, the digital overlords now want you to go the other way – take our perfectly sensible denary numbers and cram them into the world of fixed point binary. It's like trying to fit a particularly awkward octopus into a very specific jam jar.

If you're dealing with the nice, well-behaved whole number part of your denary number, the process is pretty much what you'd expect. You just keep dividing by 2 and noting down the remainders (those 0s and 1s) until you hit zero. Then you read the remainders in reverse, and Bob's your uncle – the whole number bit is sorted.

But then you've got those pesky fractions after the decimal point. They don't behave so nicely. To convert them, you have to get into a multiplying mood. You take the fractional part and keep multiplying it by 2. Each time you do this, you look at the bit that pops up *before* the decimal point (it will be either a 0 or a 1). You write these down, from top to bottom, and that's your fractional part in binary. You keep going until you hopefully end up with exactly 1.0. Sometimes, though, these fractions can be a bit stubborn and never quite reach 1.0, meaning you might have to stop after a reasonable number of steps. It's a bit like chasing a digital greased pig!

Worked Examples Icon Worked example

Convert the denary number 25.625 to fixed point.

Step 1: write the binary for 25 = 11001.

Step 2: multiply the fractional part (0.625) by 2:

0.625 × 2 = 1.25 (integer part: 1)

Then multiply the fractional part (0.25) by 2: 0.25 × 2 = 0.5 (integer part: 0)

Continue multiplying the fractional part by 2: 0.5 × 2 = 1.0 (integer part: 1)

Step 3: write the binary for the fraction (top to bottom): 101

So the answer is 11001.101

Guide Icon Guided Practice

1. Convert the fixed point number 0110.11 to denary.

Step 1: Copy the table and write the bits in the first row. The first two have been done for you.

0110.11
× 23× 22× 21× 20.× 2-1× 2-2
04.

Step 2: Write the results of each multiplication. The first two have been done for you.

0 + 4 + 2 + 0 . 0.5 + 0.25

Step 3: Add the results.

Answer: 6.75

2. Convert the fixed point number 10011.1010 to denary.

Step 1: Copy the table and write the bits in the first row.

10011.1010
× 24× 23× 22× 21× 20.× 2-1× 2-2× 2-3× 2-4
.

Step 2: Write the results of each multiplication in the third row of the table.

Step 3: Add the results.

Answer: 19.625

3. Convert the denary number 13.625 to fixed point (assume 8 bits total, 4 integer and 4 fractional).

Step 1: Write the binary for 13.

1310 = ____

Step 2: Multiply the fractional part (0.625) by 2:

0.625 × 2 = 1.25

Then multiply the fractional part of the result by 2:

0.25 × 2 = 0.50

Then multiply the fractional part of the result by 2:

0.50 × 2 = 1.00

Then multiply the fractional part of the result by 2:

0 × 2 = 0.00

Step 3: Write the binary for the fraction (top to bottom of the integer parts of the results):

The binary for the fraction is: ____

The answer is: 1101.1010

4. Convert the denary number 6.8125 to fixed point (assume 8 bits total, 4 integer and 4 fractional).

Step 1: Write the binary for 6.

610 = ____

Step 2: Multiply the fractional part (0.8125) by 2:

0.8125 × 2 = ____

Then multiply the fractional part of the result by 2:

____ × 2 = ____

Then multiply the fractional part of the result by 2:

____ × 2 = ____

Then multiply the fractional part of the result by 2:

____ × 2 = ____

Step 3: Write the binary for the fraction (top to bottom of the integer parts of the results):

The binary for the fraction is: ____

The answer is: 0110.1101

Task List Icon Independent Practice

  1. Convert the fixed-point number 0100.101 to denary.
  2. Convert the fixed-point number 1010.011 to denary.
  3. Convert the fixed-point number 0111.1101 to denary.
  4. Convert the fixed-point number 11001.0011 to denary.
  5. Convert the fixed-point number 010101.10101 to denary.
  6. Convert the denary number 6.75 to fixed-point (8 bits total, 4 integer, 4 fractional).
  7. Convert the denary number 10.375 to fixed-point (8 bits total, 4 integer, 4 fractional).
  8. Convert the denary number 25.5 to fixed-point (8 bits total, 5 integer, 3 fractional).
  9. Convert the denary number 18.125 to fixed-point (8 bits total, 5 integer, 3 fractional).
  10. Convert the denary number 3.625 to fixed-point (8 bits total, 3 integer, 5 fractional).

Answers

  1. 4.625
  2. 10.375
  3. 7.8125
  4. 25.1875
  5. 21.65625
  6. 0110.1100
  7. 1010.0110
  8. 11001.100
  9. 10010.001
  10. 011.10100