Real numbers include whole numbers, rational numbers like fractions and decimals, and irrational numbers like pi. They can be positive, negative or zero. In computing, real numbers are represented using floating point notation, which stores numbers as a mantissa and exponent. The mantissa holds the significant digits of the number, while the exponent tracks the decimal place. Increasing the bit size of the mantissa improves accuracy, while increasing the exponent size expands the representable range of numbers.
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
Real Numbers: Whole, Rational, Irrational and their Floating Point Representation
1.
2.
3. Standard Form Standard form is a scientific notation of representing numbers as a base number and an exponent . Using this notation: The decimal number 8674.26 can be represented as 8.67426 x 10 3 , with mantissa = 8.67426 , base = 10 and exponent = 3 The decimal number 753.34 can be represented as 7.5334 x 10 2 , with mantissa = 7.5334 , base = 10 and exponent = 2 The decimal number 0.000634 can be represented as 6.34 x 10 -3 , with mantissa = 6.34 , base = 10 and exponent = -3 Any number can be represented in any number base in the form m x b e
4. Floating Point Notation In floating point notation, the real number is stored as 2 separate bits of data A storage location called the mantissa holds the complete number without the point. A storage location called the exponent holds the number of places that the point must be moved in the original number to place it at the left hand side.
5. Floating Point Notation What is the exponent of 10110.110 ? The exponent is 5 , because the decimal point has to be moved 5 places to get it to the left hand side. The exponent would be represented as 0101 in binary
6. Floating Point Notation How would 10110.110 be stored using 8 bits for the mantissa and 4 bits for the exponent? We have already calculated that the exponent is 5 or 0101 . 10110.110 = 10110110 x 2 5 = 10110110 x 2 0101 It is not necessary to store the ‘x’ sign or the base because it is always 2. Mantissa Exponent
7. Floating Point Notation How would 24.5 be stored using 8 bits for the mantissa and 4 bits for the exponent? In binary, the numbers after the decimal point have the following place values: 1/2 1/4 1/8 1/16 1/32 1/64 1/128 24 has the binary value 11000 0.5 (or 1/2 ) has the binary value .1 24.5 = 0011000.1
8. Floating Point Notation How would 0011000.1 be stored using 8 bits for the mantissa and 4 bits for the exponent?
9. Floating Point Notation How would 0011000.1 be stored using 8 bits for the mantissa and 4 bits for the exponent? The exponent is 7 because decimal point has to move 7 places to the left 0011000.1 = 00110001 x 2 7 = 00110001 x 2 0111 Mantissa Exponent
10. Accuracy Store 110.0011001 in floating point representation, using 8 bits for the mantissa and 4 bits for the exponent. Mantissa Exponent The mantissa only holds 8 bits and so cannot store the last two bits These two bits cannot be stored in the system, and so they are forgotten. The number stored in the system is 110.00110 which is less accurate that its initial value.
11. Accuracy If the size of the mantissa is increased then the accuracy of the number held is increased . Mantissa (10 bits) Exponent
12. Range If increasing the size of the mantissa increases the accuracy of the number held, what will be the effect of increasing the size of the exponent? Using two bits for the exponent, the exponent can have the value 0-3 Mantissa Exponent (2 bits) This means the number stored can be in the range .00000000 (0) to 111.11111 (7.96875)
13. Range Increasing the exponent to three bits, it can now store the values 0-7 Mantissa Exponent (3 bits) This means the number stored can be in the range .00000000 (0) to 1111111.1 (127.5) If the size of the exponent is increased then the range of the number s which can be stored is increased .