please help me to fix this error " HDL code generation for fixed point division is only supported when 'RoundMode' is 'Fix' or 'Nearest' "

3 views (last 30 days)
jebli med
jebli med on 5 Mar 2017
Answered: Kiran Kintali on 30 Jun 2021
functionc = fi_div(a,b)
coder.inline('always');
ifisfi( a ) && isfi( b )
a1 = fi( a,'RoundMode','fix');
b1 = fi( b,'RoundMode','fix');
c1 = divide( divideType( a1, b1 ), a1, b1 );
c = fi( c1, numerictype( c1 ), fimath( a ) );
else
c = a / b;
end
end
%

Answers (1)

Kiran Kintali
Kiran Kintali on 30 Jun 2021
If this is staill an issue please share dut.m (design) and testbench.m (testbench calling the design) and a project file that is used for fixed-point conversion.
Thanks

Categories

Community Treasure Hunt

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

Start Hunting!