Hello there I need to store 0.2730 using IEEE format. Now what I did was to set the sing at 0 because the number is positive. Now I thought that that since what’s before the point is 0 then I don’t have to do any conversion to it because 0 in binary it’s just 0 so the exponent would end up being 0 and I just needed to convert 127 to binary. When I looked for the Mantissa I tried to do the pattern when I multiply the decimal part by 2 and take out the number before the I can’t find a pattern nor it reaches 0 so what I did was just multiply until I found 23 bits. Now when I looked up the real value it says that the exponent should be 125 and that the number is actually 0 0111 0001 0111 1000 1101 0101 000. Now I don’t know why I have to subtract 2 from the exponent since I think I don’t have to move the point nor when to stop when doing the multiplication by 2 pattern. I left a picture of my work in case it helps. Thanks in advance and hope you are doing well
The sign of 0.2730 is positive, so the sign bit in IEEE-754 binary32 format will be zero.
Next, represent the number with an explicit scaling by a power of 2: 0.2730 = 0.2730 • 20. In this, we call the part before the “•” (0.2730) the significand, and the power that 2 is raised to is the exponent.
Then, adjust this representation to make the significand be at least 1 and less than 2. The allowed adjustments are to adjust the exponent by increments of one and multiply or divide the significand by 2 accordingly: 0.2730 • 20 = 0.5460 • 2−1 = = 1.0920 • 2−2.
This is called the normalized form. The exponent in this form, −2 is used for the encoding. To encode it in the exponent bits, we add the fixed bias of the format, 127, and write the result in 8-bit binary. −2 + 127 = 125, and 125 in binary is 01111101.
Next, write the significand in binary to at least 24 digits: 1.0920 = 1.0001011110001101010011111101111100111011…2. The bold shows the first 24 digits. We can only use 24 digits in the IEEE-754 binary32 format, and we see the remaining part is above half of the 24th digit, so we will round up, producing 1.000101111000110101010002. That is our significand in binary. (For information on doing this, see “Decimal to binary” below.)
To encode the significand, we use the 23 digits after the “.” (The leading digit is known to be 1, because we normalized the number to make it so, so it does not need to be included in the bits that primarily encode the significand.) Those bits are 00010111100011010101000.
Then we put the sign, exponent, and significand bits together: 0 01111101 00010111100011010101000.
To convert the decimal numeral 1.0920 to binary:
Continue as long as desired.