How can I use floating point math on a floating point F28335 target?
Submitted by Joe on Thu, 06/13/2013 - 07:36
I understand that the Delfino F28335 has a floating point unit inside. In the VisSim menu, under 'blocks', I see fixed point math blocks. Do I have to use those fixed-point blocks for an embedded target? If not, how can I use floating point math with the 28335 as the target?
Answers
-
Submitted by Anders89 on Thu, 06/13/2013 - 07:59.
Aside from the fixed-point blocks, VisSim blocks can be floating-point, matrix, string or integer. You can use all blocks on either a fixed point MCU or a floating point MCU. It's just that floating point blocks will run pretty slowly on a fixed-point MCU. If you turn on menu item View > Data Types, the block connectors will be colored by data type:
Type Color floating-point red matrix purple integer green string blue fixed-point/scaled-integer yellow So if you see any red or purple in your diagram, you can rest easy knowing you are using the FPU on your MCU.
0 -
Submitted by rt54321 on Thu, 06/13/2013 - 08:40.
Thank you for your fast response!
--> Does this mean that, for example, if I use the multiplier block under 'Blocks -> Arithmetic -> *', that this will automatically be a floating point multiplier, if I have floating point inputs to it?
0 -
Submitted by Anders89 on Thu, 06/13/2013 - 09:03.
If you use the Blocks -> Arithmetic -> multiplier block, it will generate a floating point multiply regardless of the input type. Even if you use fixed-point inputs, they will be converted to floating point, then multiplied in floating point.
0