
元データを変更せずに、符号なしの固定小数点データを符号ありの固定小数点データに変更する方法はありますか?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 13 Sep. 2023
Bearbeitet: MathWorks Support Team
am 27 Okt. 2023
MATLABコードとSimulinkモデルにおいて、元データを変更せずに、符号なしの固定小数点データを符号ありの固定小数点データに変更する方法について教えてください。
例えば、「3 bit データ ”7” を 符号ありの固定小数点データ(-0.25)に変更」など。
Akzeptierte Antwort
MathWorks Support Team
am 27 Okt. 2023
Bearbeitet: MathWorks Support Team
am 27 Okt. 2023
MATLAB コマンドベースの場合
Fixed-Point Designer の関数 "reinterpretcast" を使用することができます。
>> u=fi(7,0,3,0);
>> y=reinterpretcast(u,numerictype(1,3,2))
y =
-0.2500
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 3
FractionLength: 2
*関数 "reinterpretcast" は、コード生成(C,HDL) 対応
Simulink モデルの場合
Data Type Conversionブロックの”整数格納(SI)” を使用できます。

0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu HDL Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!