正在加载图片...
Lecture note 1 Numerical Analysis 1.3 Round off errors and Computer arithmetic 1.3.1 IEEE floating point representation Binary(machine)representation of numbers (11011.01)2=1×24+1×22+0×22+1×21+1×20 +0×2-1+1×2-2 -16+8+2+1+分 =27.25 .Examples:Integers:(111...1)2 =2n-1 Fraction::(0.111.1)2=1-六 IEEE Floating Point Arithmetic Standard 754-1985.A machine number has three parts:Long real(64 bit),double precision 63|62 52|510 Exponent Mantissa -sign (1 bit):s -exponent (11 bit):c -mantissa(52 bit):f ·Conversion formula: x=(-1)2c-1023(1+f) ·Example: |0|100..0111011010.0 -s=0 -c=(100..011)2=210+2+1=1027 -f=(0.101101..02=立+3+六+高=0.703125 thsx=(-1)°21027-1023)(1.703125)=27.25 .What are the possible values for s,c and f. s={0,1}={+,-} c={0,1,2,3,211-1}={0,1,2,3,,2047}c-1023={-1023,.,1024 f=0壶0是1-} 123Lecture note 1 Numerical Analysis 1.3 Round off errors and Computer arithmetic 1.3.1 IEEE floating point representation • Binary (machine) representation of numbers (11011.01)2 = 1 × 2 4 + 1 × 2 2 + 0 × 2 2 + 1 × 2 1 + 1 × 2 0 + 0 × 2 −1 + 1 × 2 −2 = 16 + 8 + 2 + 1 + 1 4 = 27.25 • Examples: Integers: (111 . . . 1)2 = 2n − 1 Fraction: (0.111 . . . 1)2 = 1 − 1 2n • IEEE Floating Point Arithmetic Standard 754-1985. A machine number has three parts: Long real (64 bit), double precision 63 62 52 51 0 S Exponent Mantissa – sign (1 bit): s – exponent (11 bit):c – mantissa (52 bit):f • Conversion formula: x = (−1)s 2 c−1023(1 + f) • Example: 0 100. . . 011 1011010.. . 0 – s = 0 – c = (100 . . . 011)2 = 210 + 2 + 1 = 1027 – f = (0.101101 . . . 0)2 = 1 2 + 1 8 + 1 16 + 1 64 = 0.703125 thus x = (−1)02 (1027 − 1023)(1.703125) = 27.25 • What are the possible values for s, c and f. s = {0, 1} = {+, −} c = {0, 1, 2, 3, . . ., 2 11−1} = {0, 1, 2, 3, . . ., 2047} c−1023 = {−1023, . . ., 1024} f = {0, 1 2 52 , 2 2 52 , 3 2 52 , . . . , 1 − 1 2 52 } 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有