floating point form Flashcards
what is fixed point binary
when the numbers have a predetermined number of bits before and after the point
advantages of fixed point
makes numbers easier to process
disadvantages of fixed point
they cannot represent the range or accuracy of numbers that may be required
what are floating point numbers
when the number is expressed in m x 10^n where m is known as the mantissa and n is the exponent
if the number is positive, what should it start with, in floating point form
01
if the number is negative, what should it start with in floating point form
10
what does it mean for a number to be normalised
it either starts with 10 or 01
what does the exponent do
scales the mantissa by a power of two
floating point formula
FloatingPoint=Mantissa×2
^Exponent
why is normalisation important
-Maximises precision / accuracy for given number of bits;
- Unique representation of each number // simpler to test for equality of numbers;
uses of fixed vs floating point
Fixed point: Good for applications where speed is important and the range of values is small (e.g., financial systems).
Floating point: Better for representing a wide range of values but more complex in terms of calculations (e.g., scientific calculations, graphics processing).
what is an absolute error
The difference between the exact value and the approximate value stored in the system.
what is a relative error
The absolute error divided by the exact value.
compare absolute and relative errors
For Large Magnitude Numbers:
Absolute errors tend to be larger, but relative errors may be small since the error is small relative to the large value.
Example: A small absolute error on a large value like
10^6 may result in a very small relative error.
For Small Magnitude Numbers:
Even a small absolute error can cause a large relative error. This can be problematic when dealing with numbers close to zero.
Example: If the exact value is 0.001 and the stored value is 0.0009, the relative error will be much larger compared to a large number.
what is a rounding error
occurs when a number can’t be represented exactly within the limits of a system’s precision, and so it must be rounded to the nearest representable value.