Bias block not working properly with fixed point data type

4 ビュー (過去 30 日間)
ALi Falahati
ALi Falahati 2023 年 2 月 16 日
コメント済み: ALi Falahati 2023 年 2 月 20 日
Even though in the documentation of the bias block it supports fixed point types, it doesn't behave correctly when given a fixed point input.
I gave a u-1 bias block an input with data type fixdt(0, 12, 0) with value of 2220 and the output was 2220 instead of 2219.

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 2 月 20 日
fixdt(0, 12, 0) means "unsigned". The Bias block does the "Y=U+Bias" operation. The value of -1 can't be represented. If you try "Y=U+1", the result is correct.
If you choose fixdt(1,12,0), which means "signed", then "Y=U+1" or "Y=U-1" both show correct result.
  1 件のコメント
ALi Falahati
ALi Falahati 2023 年 2 月 20 日
So the issue was with the unsigned data type. Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

製品


リリース

R2022b

Translated by