Bias block not working properly with fixed point data type
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
ALi Falahati
il 16 Feb 2023
Commentato: ALi Falahati
il 20 Feb 2023
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.
0 Commenti
Risposta accettata
Fangjun Jiang
il 20 Feb 2023
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Sources in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!