13.3 Floating-point numbers, representation and manipulation Flashcards
Convert this binary floating point number into denary
Mantissa: 01011010
Exponent: 00000100
11.25
10 bit Mantissa
6 bit Exponent
Both two’s complement.
Calculate -7.25 in this system.
Mantissa: 1000110000
Exponent: 000011
Two’s complement system. Calculate denary value of given binary floating-point number.
Mantissa: 1011000111
Exponent: 000111
- 78.25
What does changing Mantissa vs Exponent do?
Mantissa = Precision Exponent = Range
Normalize the two’s complement floating-point number.
Mantissa: 0000000111
Exponent: 100111
Mantissa = 0111000000 Exponent = 100001
Two’s complement form.
12 bit Mantissa. 4 bit Exponent.
Represent +2.5 in floating-point representation.
Mantissa = 010100000000 Exponent = 0010
Two’s complement form.
12 bit Mantissa. 4 bit Exponent.
Represent -2.5 in floating-point representation.
Mantissa = 101100000000 Exponent = 0010
What makes a floating-point system normalized?
The first two bits should be different.
Write the largest possible number that can be represented with an 8 bit Mantissa and 4 bit Exponent.
Mantissa = 01111111 Exponent = 0111
Write the smallest positive number that can be represented with an 8 bit Mantissa and 4 bit Exponent.
Mantissa = 01000000 Exponent = 1000
A student enters the following code into an interpreter. X = 0.1 Y = 0.2 Z = 0.3 OUTPUT (X + Y + Z)
The student is surprised to see the output:
0.6000000000000001
Explain why this is output.
- As these numbers cannot be represented exactly in binary as there are rounding errors
- Adding two or more of these inaccurate representations increases the probability of inaccuracy.
- Which may give an answer where the different added inaccuracies can be large enough to be seen.
………………………………………… can occur in the exponent of a floating-point number, when the exponent has become too large to be represented using the number of bits available.
Overflow
A calculation results in a number so small that it cannot be represented by the number of bits
available. This is called …………………………………………
Underflow