Convert between floating points

I am trying to convert an IEEE based floating point number to a MIL-STD 1750A floating point number.

I have attached a specification for both: alt text

I understand how to decompose the smooth point 12.375 in IEEE format according to the example on wikipedia.

However, I am not sure if MIL-STD is interpreted correctly.

12.375 = (12) b10 + (0.375) b10 = (1100) b2 + (0.011) b2 = (1100.011) b2 (1100.011) b2 = 0.1100011 x 2 ^ 4 => Exponent, E = 4.

4 in the normalized 2 supplement = (100) b2 = indicator

Therefore, the 32-bit floating-point number MIL-STD 1750A:

S=0, F=11000110000000000000000, E=00000100

Is my interpretation correct?

For -12.375, is this just a bit of a sign that swaps? ie:

S=1, F=11000110000000000000000, E=00000100

Or is something scared going on with part of the faction?

+3
1

, . IEEE, , . . MIL-STD , , , 23 .

S=1, F=00111010000000000000000, E=00000100
+4

Source: https://habr.com/ru/post/1770230/


All Articles