To any controller, the language known is binary or hexadecimal. Thus we need a number system by which we can convert our floating point numbers to hexadecimal format.
Since your DSP is a 32 bit fixed point processor, we follow the 8.24 format of representing floating numbers.
The first 8 bits are for integral part, while the last 24 bits are for decimal part.
Of the first 8 bits, the first bit is reserved for sign, i.e., if it is 1, number is negative and if 0, number is positive.
Thus we can represent any number between -128 to 127 using this format.
To represent any floating number, the mathematics involved is:
8.24 Hex = Hex of( number_in_float * (2^24) )
Eg.
Number in float = 0.25
Hex of ( 0.25 * 2^24) = Hex of ( 4194304) = 400000
Similarly for -0.25 we get FFC00000
For the reverse process, i.e., to get float from 8.24 hex, use the below mathematics:
Float = (decimal of(number in hex))/ (2^24)
Eg 0x00A01456 gives 0.625310301780701
32 Bit Multiplication
If we multiply two 8.24 hexadecimal numbers, we get a 64 bit output. To convert this output to the desired 32 bit 8.24 format, remove the first 8 bits and last 24 bits of the obtained output
Hope this helps..
Utkarsh Mathur