How to remove the error 'the combination of fixed point and floating point is not supported'?

I want to convert matlab function to vhdl.
the function is mod.
During fixed point conversion it gives the above error with a redmark on the bold words in following line:
y = fi( mod( u, 2*pi ), 0, 14, 23, fm);
how to remove this error?

 Accepted Answer

My guess is that "u" is fixed point type. pi is a floating point type, and you probably cannot use mod() of a fixed point value with respect to a floating point value.
The fix, if I am right:
TwoPi = fi(2*Pi, 0, 14, 23, fm);
y = mod(u, TwoPi);

More Answers (0)

Categories

Find more on Code Generation in Help Center and File Exchange

Products

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!