Computer Number Representation The Exponent o The exponent's base is two. o Why bias??The exponent field needs to represent both positive and negative exponents. Effective Exponent Exponent stored-Bias For IEEE single-precision floats,the exponent field is 8 bits, Bias=127. o For IEEE double-precision floats,the exponent field is 11 bits,Bias-1023. IEEE reserves exponent field values of all 0s and all 1s to denote special values in the floating-point scheme. 1口“4元,4元t重QC Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09201512/103
Computer Number Representation The Exponent The exponent’s base is two. Why bias?? The exponent field needs to represent both positive and negative exponents. Effective Exponent = Exponent stored − Bias For IEEE single-precision floats, the exponent field is 8 bits, Bias=127. For IEEE double-precision floats, the exponent field is 11 bits, Bias=1023. IEEE reserves exponent field values of all 0s and all 1s to denote special values in the floating-point scheme. Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 12 / 103
Computer Number Representation The Mantissa o The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. Normally a floating-point number x (single-precision)is stored as normal Xioat=(-1)s×1.f×2e-bias Mantissa=1.f=1+m22×2-1+m21×2-2+. +%×2-23 o 24 bits of resolution for single-precision float. o Denormalized numbers have e00 denormalized xoe =(0.x 2-126 (e =0 口回1元,4元t至0QC Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09201513/103
Computer Number Representation The Mantissa The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. Normally a floating-point number x (single-precision) is stored as normal xfloat = (−1) s × 1.f × 2 e−bias Mantissa = 1.f = 1 + m22 × 2 −1 + m21 × 2 −2 + · · · + m0 × 2 −23 24 bits of resolution for single-precision float. Denormalized numbers have e = 0, f 6= 0, denormalized xfloat = (−1) s × 0.f × 2 −126 (e = 0) Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13 / 103
Computer Number Representation The Mantissa o The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. o Normally a floating-point number x(single-precision)is stored as normal Xiloat=(-1)s×1.f×2e-bias Mantissa=1.f=1+m22×2-1+m21×2-2+.. +m×2-23 o 24 bits of resolution for single-precision float. o Denormalized numbers have e-0,f0. denormalized Xnoat=(-1)°×0.f×2-i26(e=0 口回1元,4元t至0QC Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13/103
Computer Number Representation The Mantissa The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. Normally a floating-point number x (single-precision) is stored as normal xfloat = (−1) s × 1.f × 2 e−bias Mantissa = 1.f = 1 + m22 × 2 −1 + m21 × 2 −2 + · · · + m0 × 2 −23 24 bits of resolution for single-precision float. Denormalized numbers have e = 0, f 6= 0, denormalized xfloat = (−1) s × 0.f × 2 −126 (e = 0) Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13 / 103
Computer Number Representation The Mantissa o The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. o Normally a floating-point number x(single-precision)is stored as normal Xiloat=(-1)s×1.f×2e-bias Mantissa=1.f=1+m22×2-1+m21×2-2+.. +m×2-23 o 24 bits of resolution for single-precision float. o Denormalized numbers have e=O,f≠0, denormalized Xoat=(-1)F×0.f×2-12s(e=0) 口回1元,4元t至0QC Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13/103
Computer Number Representation The Mantissa The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. Normally a floating-point number x (single-precision) is stored as normal xfloat = (−1) s × 1.f × 2 e−bias Mantissa = 1.f = 1 + m22 × 2 −1 + m21 × 2 −2 + · · · + m0 × 2 −23 24 bits of resolution for single-precision float. Denormalized numbers have e = 0, f 6= 0, denormalized xfloat = (−1) s × 0.f × 2 −126 (e = 0) Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13 / 103
Computer Number Representation The Mantissa o The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. o Normally a floating-point number x(single-precision)is stored as normal Xiloat=(-1)s×1.f×2e-bias Mantissa=1.f=1+m22×2-1+m21×2-2+.. +m×2-23 o 24 bits of resolution for single-precision float. ●Denormalized numbers have e=O,f≠O, denormalized=(-1)°×0.f×2-126(e=0) 至0QC Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13/103
Computer Number Representation The Mantissa The first bit of the mantissa is typically assumed to be 1.f, where f is the field of fraction bits. Normally a floating-point number x (single-precision) is stored as normal xfloat = (−1) s × 1.f × 2 e−bias Mantissa = 1.f = 1 + m22 × 2 −1 + m21 × 2 −2 + · · · + m0 × 2 −23 24 bits of resolution for single-precision float. Denormalized numbers have e = 0, f 6= 0, denormalized xfloat = (−1) s × 0.f × 2 −126 (e = 0) Weihua Gu (Shanghai Jiao Tong University) Computational Physics Chapter 1 14/09/2015 13 / 103