(定点转换器)1000位分数长度在2 ^ x从.mat如果x是加载文件?

1视图(30天)
我有一个问题在定点转换器下面这样的代码:
dut_tb.m
dut (8);
dut.m
函数= dut(中)
S = coder.load (“constants.mat”);
在+ 2 = ^ S.exponent;
结束
storeConstants.m
函数[]= storeConstants ()
指数= 8;
保存(“constants.mat”);
结束
convert.m
exArgs = {8};
fc = coder.config (“fixpt”);
fc。TestBenchName =“dut_tb”;
codegen-float2fixed fc args exArgs dut
重现步骤:
运行storeConstants然后转换。
定点自动转换器使用一小部分长度为1000的两个操作。
这只是一个简单的bitshift硬件,我看不到这个精度高的目的。怎么能
我禁用这个巨大的部分的长度吗?

接受的答案

Jan Siegmund
Jan Siegmund 2020年4月15日
一个临时修复使用 bitsll 推荐 在这里 :
对于有效的HDL代码生成,使用定点设计功能 bitsll , bitsrl , bitsra 而不是 bitshift
所以我交换
在+ 2 = ^ S.exponent;
=在+ bitsll (uint8 (1) S.exponent);
Uint8被使用,因为我想要结果无符号,因为它需要使用分频器。
1评论
Kiran Kintali
Kiran Kintali 2020年4月18日
谢谢你的输入。我们将看到如果我们能自动转换过程中生成这个建议在未来的版本。

登录置评。

答案(1)

张正
张正 2020年4月13日
我有时也会找到fixedpoint-tool不容易理解。我经常第一个m从浮点转换为定点,然后将它们转换为hdl代码或c代码。
2的评论

登录置评。

类别

找到更多的在FPGA、ASIC和SoC发展帮助中心文件交换

下载188bet金宝搏


释放

R2019b

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!