how to make HDL coder optimize the multiplication with a small constant to shift right?
Mostrar comentarios más antiguos

mu2 is a very small constant ,which is on the order of 1e-6.
mu2 has to be multiplied by xi and yi.
xi times yi is variable which is on the order between 1 and 1e4.
I tried the shift arithmetic module but the result was wrong ಥ﹏ಥ
Thanks for helping me!
5 comentarios
Walter Roberson
el 26 de Abr. de 2023
Are you (already) coding the signals as fixed-point? If so I might suggest using a math block and letting Simulink and HDL Coder take care of the optimization
Zora Aria Jade
el 26 de Abr. de 2023
Bharath Venkataraman
el 26 de Abr. de 2023
HDL Coder is saying that the model cannot be compiled.
Could you try to run the model and see if you get any errors?
Alternatively, can you uncheck the "Generate test bench" box and see if HDL Code generation is successful?
Zora Aria Jade
el 27 de Abr. de 2023
Bharath Venkataraman
el 1 de Mayo de 2023
We may need to look at your model to see what the issue is. You can post it here if that is acceptable. Otherwise, it is best if you contact MATLAB technical support.
Respuestas (0)
Categorías
Más información sobre Get Started with HDL Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



