In the given floating point number system,
To represent 0.209 in this number system-
Convert 0.209 to binary: 0.209 * 2 = 0.418 - 0 (the integer part) = 0.418 0.418 * 2 = 0.836 - 0 (the integer part) = 0.836 0.836 * 2 = 1.672 - 1 (the integer part) = 0.672 0.672 * 2 = 1.344 - 1 (the integer part) = 0.344 0.344 * 2 = 0.688 - 0 (the integer part) = 0.688 0.688 * 2 = 1.376 - 1 (the integer part) = 0.376 0.376 * 2 = 0.752 - 0 (the integer part) = 0.752 0.752 * 2 = 1.504 - 1 (the integer part) = 0.504 0.504 * 2 = 1.008 - 1 (the integer part) = 0.008 0.008 * 2 = 0.016 - 0 (the integer part) = 0.016 0.016 * 2 = 0.032 - 0 (the integer part) = 0.032 0.032 * 2 = 0.064 - 0 (the integer part) = 0.064 0.064 * 2 = 0.128 - 0 (the integer part) = 0.128 0.128 * 2 = 0.256 - 0 (the integer part) = 0.256
0.209 in binary = 0.001101010001...
Since there are 5 bits reserved for the integer part, we can represent integer part of the binary number above: 0.00110 = 0x0.6 in hexadecimal.
The remaining bits should represent the fractional part of the binary number, but since we cannot cover all the remaining bits, we have to round. The next binary digit is 1 which creates at least a distance of 2 * the value of the next bit. We need to check the next two digits as well: the third is 0 so we are beyond the rounding point. Thus, the binary representation becomes 0.001101010011 (the rounded part is in bold)
The value of this binary number in decimal is: 0.001101010011... = 2^-2 + 2^-4 + 2^-7 + 2^-8 + 2^-9 = 0.171875
Finally, to normalize the number, we shift the binary point 9 bits to the left and increment the exponent accordingly. Therefore, the normalized, regularly rounded representation of 0.209 in matlab is 0.209 = 1.71875 * 2^(-4)
0.209 in the given floating point number system f=[a=2,k−=−5,k+=5,t=5] has the normalized, regularly rounded representation of 1.71875 * 2^(-4).
gistlibby LogSnag