RndTool.info ⚡

Decimal to IEEE 754 Scientific-calculator-based Step-by-step Calculator




Loading...

Decimal to IEEE 754 with Scientific Calculator Steps

Question Examples:

Question 1: Convert 4.00012 to a 32-bit IEEE 754 single-precision floating-point format, and represent datum of address ADDR+00H to ADDR+03H in big endian. (Only scientific calculator can be used.)


Answer:

Decimal value for IEEE 754 = (-1)S×(1+.M)×2E-bias

S = 0 (since it is a positive number)

Exponent:
Exponent = log(4.00012)log(2)≈2
(E = exponent + bias = 2 + 127 = 129)
E = 1000 00012

1+.M = 4.0001222≈1.00003
.M ≈ 0.00003
Convert 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: .0000000000000001111101112
Fraction 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 100


Binary of to IEEE single-precision floating point number:
SignExponentMantissa
0100000010000 0000 0000 0001 1111 100

Hexadecimal digit sequence:

01000000100000000000000011111100
408000FC

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:
AddressContent
ADDR+00H40
ADDR+01H80
ADDR+02H00
ADDR+03HFC