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 (2026). Two's Complement Binary Strings (https://kr.mathworks.com/matlabcentral/fileexchange/38889-two-s-complement-binary-strings), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Characters and Strings에 대해 자세히 알아보기
도움

도움 준 파일: DI-155 Acquisition V1.0

버전 게시됨 릴리스 정보
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