It does not appear that Simulink will properly produce full-precision adders. For example: If I want to add 2 signals with data types:
sfix10_En6 –> Range [-8,8), Precision 2e-6
and
ufix10_En10 –> Range [0,1), Precision 2e-10
then Simulink will propagate the output data type of an adder to be:
sfix16_En6 –> Range [-512,511), Precision 2e-6
This is satisfactory for the range, but not for the precision. In order to get full precision out of the adder, I would expect the minimal propagated type to be:
sfix15_En10 –> Range [-16,16), Precision 2e-10
This is non-intuitive. I realize that one could pad fractional bits to the first signal to "line up" the binary point prior to adding. It is not clear that this is possible to do programmatically, though, without having full access to the Fixed-Point characteristics of bit width + fraction length at compile time. I could easily query the input data types and appropriately set the output type if the binary point values were available by the API.
Does anyone know of a plan to accommodate this feature?
Thank you, -Tim Koehler
Best Answer