Two's Complement Binary Strings
Versione 2.0.0.0 (4,32 KB) da
Drew Compston
Convert between binary fixed point two's complement strings and decimal numbers.
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.
Cita come
Drew Compston (2026). Two's Complement Binary Strings (https://it.mathworks.com/matlabcentral/fileexchange/38889-two-s-complement-binary-strings), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2007b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Scopri di più su Characters and Strings in Help Center e MATLAB Answers
Tag
Riconoscimenti
Ispirato: DI-155 Acquisition V1.0
Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
