Decimal value for IEEE 754 = (-1)
S×(1+.
M)×2
E-biasS = 0 (since it is a positive number)
Exponent:
Exponent =
log(4.00012)⁄
log(2)≈2
(
E = exponent + bias = 2 + 127 = 129)
E =
1000 000121+.
M =
4.00012⁄
22≈1.00003
.
M ≈ 0.
00003Convert 0.
00003 to binary:
Multiply by 2 for Fraction Part: |
0.00003 | × 2 = | 0.00006 | | ...0 |
0.00006 | × 2 = | 0.00012 | | ...0 |
0.00012 | × 2 = | 0.00024 | | ...0 |
0.00024 | × 2 = | 0.00048 | | ...0 |
0.00048 | × 2 = | 0.00096 | | ...0 |
0.00096 | × 2 = | 0.00192 | | ...0 |
0.00192 | × 2 = | 0.00384 | | ...0 |
0.00384 | × 2 = | 0.00768 | | ...0 |
0.00768 | × 2 = | 0.01536 | | ...0 |
0.01536 | × 2 = | 0.03072 | | ...0 |
0.03072 | × 2 = | 0.06144 | | ...0 |
0.06144 | × 2 = | 0.12288 | | ...0 |
0.12288 | × 2 = | 0.24576 | | ...0 |
0.24576 | × 2 = | 0.49152 | | ...0 |
0.49152 | × 2 = | 0.98304 | | ...0 |
0.98304 | × 2 = | 1.96608 | | ...1 |
0.96608 | × 2 = | 1.93216 | | ...1 |
0.93216 | × 2 = | 1.86432 | | ...1 |
0.86432 | × 2 = | 1.72864 | | ...1 |
0.72864 | × 2 = | 1.45728 | | ...1 |
0.45728 | × 2 = | 0.91456 | | ...0 |
0.91456 | × 2 = | 1.82912 | | ...1 |
0.82912 | × 2 = | 1.65824 | | ...1 |
0.65824 | × 2 = | 1.31648 | | ...1 |
Fraction Binary: .000000000000000111110111
2Fraction binary for single precision mantissa = .00000000000000011111100(23-bit length only) (Since the last 24 bit fraction is 1, we add 1 to the remaining 23-bit binary to round the number)
= .
0000 0000 0000 0001 1111 100Binary of to IEEE single-precision floating point number:
Sign | Exponent | Mantissa |
0 | 10000001 | 0000 0000 0000 0001 1111 100 |
Hexadecimal digit sequence: |
0100 | 0000 | 1000 | 0000 | 0000 | 0000 | 1111 | 1100 |
4 | 0 | 8 | 0 | 0 | 0 | F | C |
4.00012 to IEEE single-precision floating point number in hexadecimal digit sequence is 408000FCH.
Datum of address ADDR+00H to ADDR+03H in big endian:
Address | Content |
ADDR+00H | 40 |
ADDR+01H | 80 |
ADDR+02H | 00 |
ADDR+03H | FC |