Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode.
4 次查看(过去 30 天)
显示 更早的评论
Hello There,
I got the following error while I'm converting my Matlab Code to HDL-coder
Error : "Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode."
Here is the matlab code :
Gx1(nn)=fi(cos_func(dr(nn)),true,16,16).*fi(call_power_func(2.718281828,double(-(double(t(nn)).*(double(t(nn))))/2)),true,16,16);
Notes:
t= (1x100000) double
max(t)= 0.999999000000000
min(t)= 0
[Merged from duplicate - WDR]
Hello There,
I got the following error while I'm converting my Matlab Code to HDL-coder, Can you please help me to fix this error? I simplified my code as below to trace the error, as it looks the Cos function is not working with HDL, even after I created a cos special func.
"Error: Found unsupported division expression for HDL code generation; Signed input data type is not supported for division with Floor RoundMode."
Here is the code:
dr=[0.26,0.36,0.76,0.5,0.75,0.33,0.67,0.87,0.98,0.21];
dr= fi(dr,true,16,16);
Gx2=zeros(1,10);
Gx2= fi(Gx2,true,16,16);
for nn=1:1:10;
Gx2(nn)=cos_func(dr(nn));
end
% code end
---
where:
function y = cos_func( x ) %#codegen
y=cos(x);
end
0 个评论
采纳的回答
Bharath Venkataraman
2015-7-14
The cos function is not supported for HDL code generation. You can use a lookup table (predefined array)that stores the cos values and look up the right value based on the input x.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!