Representation of Data (Part II) Computer Studies Notes: chapter 19 Ma King Man
Floating-point number representation E.g (2) can be written as x 2 1 or x 2 2 or x 2 3 (Normalized form)
Format The basic format is shown as follow: Sign bit Exponent Mantissa Sign bitExponentMantissa
Note… Excess 128 method That is, add 128 to the current value.
Eg 1 Assume 16-bit word and EXCESS 128 method is used: = (ii) = x 2 4 Fraction= Exponent= 4 x 128 = 132 = (ii) Since the number is positive, therefore the sign bit is 0. Therefore will be stored as
E.g = (ii) = x 2 5 (normalization) Fraction= Fraction= = 133 = (ii) Since the number is negative, therefore the sign bit is 1. Therefore –29.75 will be stored as
E.g = (ii) = -0.1 x 2 -3 (normalization) Fraction= Exponent= = 125 = (ii) Since the number is negative, therefore the sign bit is1. Therefore – will be stored as
Comparison between fixed-point representation and floating point representation Range Fixed-point numbers Largest positive number = = Smallest negative number= = Therefore, in 16-bit word storage: <= fixed point number <=
Floating-point representation AAssume excess-128 method and 16-bit word is used, a dloating point representation cab have the following values: Largest positive number= Smallest positive number=
More… Largest negative number= Smallest negative number=
More…thus… Therefore, the range of floating number: , 0, From the above, we can see that the range of the floating-point representation is wider than that of fixed-point representation.