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
- a fixed point system can represent some numbers more precisely than floating point
- calculations can be performed more quickly
- represents all numbers to a constant level of precision/accuracy
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
how do u fix it
- occurs when there are not enough bits in the mantissa to represent the number
- can be fixed by rounding to the nearest representable value
- or truncating
how to represent more numbers using the same number of bits in floating point
Move a/some bit(s) from the exponent to the mantissa
Explain why the relative error is usually considered to be a more important measure of
error than the absolute error.
The impact of an error depends on its size relative to the number that is represented
advantages of floating vs fixed point
floating point :
- a floating point system can represent numbers with a
greater range than a fixed point system;
- can represent numbers much closer to zero // can represent much smaller numbers
- can represent much larger numbers
fixed point:
- a fixed point system can represent (some) numbers more
precisely than a floating point system;
Calculations can be performed more quickly
What is the difference between absolute error and relative error?
- Absolute Error: The difference between the exact value and the computed value.
- Relative Error: The absolute error divided by the exact value, often expressed as a percentage.
What causes underflow in floating point representation?
occurs when a number is too small to be represented by the available range of the floating point format, resulting in a loss of precision.
What is overflow in floating point representation, and when does it occur?
occurs when a number is too large to be represented within the available range of the floating point format