3.5.4.4 Numbers With a Fractional Part. Flashcards
Outline the us of fixed point representation.
Used if we want to represent fractions.
We can fix the decimal point by defining our byte to represent fractions (but not actually storing the point).
How do we represent decimals and what does this involve?
Ways we can represent decimals:
325.5 can be represented as 0.3255 x 10^3
This way of representing numbers in different forms involves moving (floating) the decimal point to a new position.
We need a consistent method of representing decimals.
Outline the process of floating point notation.
In floating point notation, real numbers are represented in the following way:
- A sign ( 0 indicates a positive, 1 a negative number).
- some significant digits expressed as a number with a fractional part (mantissa).
- and an integer power of 2 (exponent).
0●1011000 0011
mantissa exponent.
When is the implied binary point?
The implied binary point is always after the first digit.
What is the exam question structure for Floating Point Numbers.
Exam questions will use 12 bit numbers:
8 bits for the mantissa
4 bits for the exponent.
How to calculate floating point numbers.
Find the sign of the mantissa - if the mantissa is negative perform two’s compliment.
- Find the value of the exponent (positive or negative).
- Move the decimal point the distance the exponent asks for (add up the positive values in the exponent) (right for a positive exponent, left for a negative exponent).
- Starting at the decimal point, work out the value of the mantissa.
Define a mantissa.
The number you want to store.
Define an exponent.
The position of the binary point in the number.
What must we remember about the exponent?
The exponent does not form part of the end number.
Outline how to float the binary point when working with a negative exponent.
Shift the entire binary number however many values specified by the exponent in the binary waiting line, add 0’s.
Outline the need for normalisation.
Normalisation overcomes the loss of a less significant bit, which will then lead to an unnecessary error, when there are leading zeros before the least significant bit.
Outline normalised floating point numbers.
With a fixed number of bits, a normalised representation of a number will display the number to the greatest accuracy possible.
Summarise what normalised numbers do.
In summary normalised numbers:
Give only one representation of a number.
Save space.
Give the most accurate representation of a number in a given number of bits.
Outline how to normalise.
The first two digits must be different.
- 0.1 (positive)
- 1.0 (negative)
Examples of normalisation:
(after floating point notation)
1101.1010 is normalised as 1.0110100 0011.
00101 normalised as 0.101000 1010