Sid M. answered 04/28/20
Senior Software Engineer, with BS, and almost MS, in Computer Science
This was fun to work out!
Remember the sign, and consider the original [decimal] number as a positive valued mantissa.
Determine the value of the mantissa as a minimum [decimal] integer times an exponent of 2. If the mantissa has a non-0 fraction, then while it has a non-0 fraction, multiply it by 2, and decrement the exponent of 2. If the mantissa has no fraction, then while it is evenly divisible by 2, divide it by 2 and increment the exponent of 2.
The result is the sign (1 or -1), its power of 2 exponent (2^N), and [decimal] value of the mantissa.
Determine the binary value of the mantissa.
Increment the exponent of 2, to move the [imaginary] decimal point of the mantissa left, until the value of the mantissa is 1 + a fraction.
If the original value was negative, the sign bit becomes 1, otherwise 0.
Adjust the exponent by adding the bias (128) to form a positive value, and convert to binary.
Drop the leading 1 bit of the mantissa, leaving only the fractional bits.
Put it all together: