メインコンテンツ

fixed.cordicReciprocal

CORDIC ベースの固定小数点の逆数

R2021b 以降

説明

y = fixed.cordicReciprocal(u,OutputType) は、OutputType で指定されたデータ型にキャストされた出力をもつ 1./u を返します。

すべて折りたたむ

u = fi(10);
outputType = fi([],1,32,24);
y = fixed.cordicReciprocal(u,outputType)
y = 
    0.1000

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 32
        FractionLength: 24

入力引数

すべて折りたたむ

逆数を求める値。スカラー、ベクトル、行列、または多次元配列として指定します。

  • u が浮動小数点型の場合、OutputType で浮動小数点データ型を指定する必要があります。

  • u が組み込み整数型の場合、OutputType で組み込み整数データ型を指定する必要があります。

  • u が固定小数点型の場合、OutputType で固定小数点データ型を指定する必要があります。

データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
複素数のサポート: あり

出力のデータ型。fi オブジェクト、numerictype、または Simulink.NumericType オブジェクトとして指定します。

  • num が浮動小数点型の場合、den も浮動小数点型でなければならず、OutputType で浮動小数点データ型を指定する必要があります。

  • num が組み込み整数型の場合、den も組み込み整数型でなければならず、OutputType で組み込み整数データ型を指定する必要があります。

  • num が固定小数点型の場合、den も固定小数点型でなければならず、OutputType で固定小数点データ型を指定する必要があります。

例: fi([],1,16,15)

例: numerictype(1,16,15)

例: fixdt(1,16,15)

ヒント

  • Real Reciprocal HDL Optimized ブロックの動作は fixed.cordicReciprocal 関数と同じです。関数への入力が 2 進小数点でスケーリングされた固定小数点データ型をもつ実数の場合、関数とブロックはビット単位で正確に一致する結果を提供します。

アルゴリズム

すべて折りたたむ

参照

[1] Volder, Jack E. “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers. EC-8, no. 3 (Sept. 1959): 330–334.

[2] Andraka, Ray. “A Survey of CORDIC Algorithm for FPGA Based Computers.” In Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays, 191–200. https://dl.acm.org/doi/10.1145/275107.275139.

[3] Walther, J.S. “A Unified Algorithm for Elementary Functions.” In Proceedings of the May 18-20, 1971 Spring Joint Computer Conference, 379–386. https://dl.acm.org/doi/10.1145/1478786.1478840.

[4] Schelin, Charles W. “Calculator Function Approximation.” The American Mathematical Monthly, no. 5 (May 1983): 317–325. https://doi.org/10.2307/2975781.

拡張機能

すべて展開する

バージョン履歴

R2021b で導入

すべて展開する