HDL Coder Signed Inputs/Outputs

1 回表示 (過去 30 日間)
Paul Sand
Paul Sand 2019 年 1 月 28 日
回答済み: Paul Sand 2019 年 1 月 28 日
I have a simple funtion to test the HDL Coder.
It is as follows:
function [sumnumn, diffnum, prodnum, quotnum] = asmd2num(a, b)
sumnum = a + b;
diffnum = a - b;
prodnum = a * b;
quotnum = a / b;
end
For the Clocks & Ports tab I have Synchronous,
Inpud data type = signed/unsigned
Output data type = signed/unsigned
Optimzations: Register Outputs
The issue is that the HDL output is always producing unsigned outputs.
How does one get SIGNED outputs?
And preferably SIGNED inputs?
Thanks

採用された回答

Paul Sand
Paul Sand 2019 年 1 月 28 日
It appears the whether one gets signed or unsigned is determined by the values in the test bench.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHDL Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by