44 total
By the end of this subtopic, you should be able to:
A real number is a number that can have a fractional part, such as 4.5, 0.25, or -10.375.
A computer can store numbers in different ways. One way is fixed-point. In fixed-point, the binary point stays in one fixed position. This is simple, but it has two big limits:
To solve this, computers can use floating-point representation. In floating-point, the binary point is allowed to “move”. This makes it possible to store a much wider range of values.
Floating-point works in a similar way to standard form in maths.
For example, in denary:
In binary floating-point:
Here:
So the mantissa gives the main digits of the number, and the exponent tells you how far the binary point moves.
A binary floating-point number is split into two parts:
The general form is:
value = mantissa × 2^exponent
In this syllabus, floating-point values use two’s complement form. This means signed values can be stored, including negative values.
A common example is:
That gives a total of 16 bits.
The mantissa is treated as a signed binary fraction. The binary point is placed after the first bit.
So if the mantissa is:
01011010
it is read as:
0.1011010
If the mantissa is negative, it is still stored using two’s complement.
The exponent is a signed integer stored in two’s complement as well.
So the whole floating-point value is:
mantissa × 2^exponent
Sign in to view full notes