I am converting an integer to a single precision floating point number.

I understand that floating point number comprises of sign bit(1 bit), exponent(8 bits) and significand(23 bits).

I can check if input < 0 and get the sign bit.

To get the exponent and mantissa, I have to convert the integer to binary.

I am using the function "to_unsigned" in VHDL.

The problem is since i dont know how big of an integer i can get as input, I dont know how i should declare the length of the binary vector . The integer to binary conversion could give me anywhere from a minumum of 1 bits to a maximum of (I dont know).

I would like to know how to solve this problem