Using DSP Signals (5.23) for Control signals (28.0)
I am trying to use some results from a DSP calculation as a control input into the State Machine block. I don't think it is working correctly. The DSP calculation is basically a first order IIR filter and an additional multiplication. My understanding is that this result will be 5.23. The State Machine control input must be a 28.0 format. Does SigmaStudio do the conversion from 5.23 to 28.0 automatically (multiplying by 2^23). Or is it not possible to use the result of a DSP calculation as a control signal.
Incidentally, why are control signals are forced to be 28.0 in the first place? Also, is the DC block the only one where the numeric format can be specified?
Thanks,
Justin
Keywords: numeric format, fixed point format, numeric scaling, number format
Hi Justin,
The entry windows on the state machine take numbers is 28.0 format. If your variable input into the state machine is in 5.23 then the numbers you type into the state machine windows must be scaled accordingly (2^23 as you correctly stated).
For example, if you wanted your state machine to operate when the input (5.23 format) is >0.5 to <0.6 then the numbers you would type into the windows would need to be:
0.5 * 2^23 = 4194304 and
0.6 * 2^23 = 5033165
The blocks within sigma studio are not inherently "aware" of what the input format is (it's just a binary number with 28 digit resolution like all values within the DSP) but the blocks do interpret any user inputs according to how they have been programmed by Analog. If the input window is expecting a 28.0 input then it's range is -134217728 to +134217727 (28 bit binary in two's compliment). If the same block were programmed by Analog to accept user inputs in 5.23 format then the range would be scaled accordingly (-16 to +15.9..), it's just an internal scaling factor that sigma studio is applying.
AFAIK the DC block and the Readback block are the only ones with adjustable number format.
Hope this helps?
David.
This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.
Thank you,
EZ Admin
Please log in to reply.