Two's Complement Binary Strings

バージョン 2.0.0.0 (4.32 KB) 作成者: Drew Compston
Convert between binary fixed point two's complement strings and decimal numbers.
ダウンロード: 2.6K
更新 2022/7/7

ライセンスの表示

These functions convert between binary strings and decimal numbers like the built-in MATLAB functions BIN2DEC and DEC2BIN but can accommodate negative integers (via two's complement) and fractional positive and negative numbers (via two's complement fixed point with a binary point in the string).
Note that many fractional numbers that can be represented with a finite number of fractional digits cannot be represented by a finite number of fractional bits (specifically non-powers-of-two fractions like 0.3), which means that FIX2DEC will not always exactly invert DEC2FIX.

引用

Drew Compston (2024). Two's Complement Binary Strings (https://www.mathworks.com/matlabcentral/fileexchange/38889-two-s-complement-binary-strings), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCharacters and Strings についてさらに検索
謝辞

ヒントを与えたファイル: DI-155 Acquisition V1.0

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
2.0.0.0

Mathworks changed the behavior of bitcmp, so I made a new function bitcmpold that reflects the old behavior of the function.

1.0.0.0