Floating Point Representation IEEE Standard 754 Floating Point

  • Slides: 7
Download presentation
Floating Point Representation Ø IEEE Standard 754 Floating Point Numbers Ø Three components Ø

Floating Point Representation Ø IEEE Standard 754 Floating Point Numbers Ø Three components Ø Sign Ø Exponent Ø Significant (Mantissa) Ø Single Precision (32 bits) Ø Sign (1 bit), Exponent (8 bits), Significant (23 bits) Ø Double Precision (64 bits) Ø Sign (1 bit), Exponent (11 bits), Significant (52 bits) 9/23/2021 1

Floating Point Representation Ø Sign Ø 0: Positive Number Ø 1: Negative number Ø

Floating Point Representation Ø Sign Ø 0: Positive Number Ø 1: Negative number Ø Exponent Ø To represent positive and negative exponents ØBias is added to the actual exponent in order to get the stored exponent ØFor an exponent 0, the stored exponent is 127 (for single precision) ØAdd 127 to get final result for presentation exponent. 9/23/2021 2

Floating Point Representation Ø Single Precision 31 30 23 22 S Exponent 0 Significant

Floating Point Representation Ø Single Precision 31 30 23 22 S Exponent 0 Significant (Mantissa) Ø Number = (-1)s * 1. Significant * 2 Ø Double Precision 63 62 52 51 S Exponent 0 Significant (Mantissa) Ø Number = (-1)s * 1. Significant * 2 9/23/2021 (Exponent +127) (Exponent +1023) 3

Floating Point Representation Ø Example 1: Present -110110011. 01 number in 32 bit IEEE

Floating Point Representation Ø Example 1: Present -110110011. 01 number in 32 bit IEEE floating point. Ø Answer; -110110011. 01 = -1. 101101 * 28 Ø Sign = 1 (because the number is negative) Ø Exponent; in the example is 8 (decimal), this means 1000 (binary) you have to add 127 to 8 to get exponent, the result is 0000 1000(8) + 0111 1111 (127) = 1000 0111 (decimal 135) Ø Mantissa= 101101 +the rest is 0 s Ø So that the presentation is; Ø 1 1000 0111 1011010000000 9/23/2021 4

Floating Point Representation Ø Example 2: Present 101. 111001 number in 32 bit IEEE

Floating Point Representation Ø Example 2: Present 101. 111001 number in 32 bit IEEE floating point. Ø Answer; 101. 111001 = 1. 01111001 * 22 Ø Sign = 0 (because the number is positive) Ø Exponent; in the example is 2 (decimal), this means 0010 (binary) you have to add 127 to 2 to get exponent, the result is 0000 0010(2) + 0111 1111 (127) = 10000001 (decimal 129) Ø Mantissa= 01111001 +the rest is 0 s Ø So that the presentation is; Ø 0 1000 0001 0111100100000000 9/23/2021 5

Conclusion Ø Most used number systems are : decimal, binary and hexadecimal. Ø Computers

Conclusion Ø Most used number systems are : decimal, binary and hexadecimal. Ø Computers store data in the form of bits, bytes, and words using the binary numbering system. Ø Hexadecimal numbers are formed using four-bit groups. Ø Signed integers can be stored in one’s complement, two’s complement, or signed magnitude representation. 9/23/2021 6

End of Chapter I 9/23/2021 7

End of Chapter I 9/23/2021 7