HDL Coder: How to multiply floating point numbers in a stateflow project?
2 views (last 30 days)
Show older comments
When I use HDL coder to produce code for the following simulink model (using the altera mega functions library), I get a complicated VHDL program that is able to handle floating points.
When I use HDL coder on the following stateflow model (again using the altera mega functions library)
I the floating point "variable" is just multiplied with the hexadecimal representation of a the floating point "1.1"
Multiplying two floating point numbers as if they were fixed point numbers obviously doesn't produce the correct result.
Is this a bug in stateflow or am I just not configuring HDL Coder correctly?
How can I solve this?
Note: I would like to avoid being restricted to fixed point numbers...
0 Comments
Answers (1)
Kiran Kintali
on 20 Oct 2020
HDL Coder does not support Stateflow models with floating-point Math in actions. Please consider using MATLAB Function block with MALTAB data path architecture to model floating-point algorithms.
0 Comments
See Also
Categories
Find more on HDL Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!