06.floating Point Numbers
06.floating Point Numbers
Numbering systems
Jari Hautamäki
Numbering systems
Floating point number
• If the number is presented by using the complement of two
• E.g.with an 8-bit processor only numbers -128...+127 can be presented
• Even with a 16-bit processor only numbers -32768...+32767 are reached
• Bigger numbers than this cannot be presented with the reserved numbers of bits
• Direct presentation is not possible with fractions.
• Hence, in computers Floating Point Representation is used:
L = S*KE
• L = number to be presented
• S = significand
• K = base number (in binary number presentation 2)
• E = exponent
12.1.2022 © Jari Hautamäki
Numbering systems
Floating point representation L = S*KE
• Enables a much wider number range representation with the same number of bits as in
straight?direct representation
Examples:
2000000 = 2*106
0.00101012 = 101012*2-7 (0.1640625 = 21*2-7)
• Can represent fractions but the precise value of zero cannot be represented
+63 = 0,111111
...
+1 = 0,000001
0 = 0,000000
- 1 = 1,111111
...
-64 = 1,000000
• The representation of the significand contains 25 bits although in the bit string?jono there are 24
• Most significant bit can be omitted from the bit string
• The number is normalized to the range 1...0,5, so that number 0.111111...˜1 and number 0.100000... ˜
12.1.2022
0,5. © Jari Hautamäki
Numbering systems
Floating point representation
• 32-bit floating number absolute value is in the range as represented previously
• 0.1111...*263 ---- 0.1*2-64 i.e. with decimal numbers 0,999...*263 ---- 0,5*2-64 i.e. 9,2*1018 - 2,7*10-20
• With a direct 32-bit number presentation we could only reach number range +231...-(231-1)
7. What is the biggest and smalles positive number that can be represented with floating number representation
with 21 bits? In the character string the expontent=4 bits and significand =16 bits long.