Code covered by the BSD License  

Highlights from
Two's Complement Binary Strings

Be the first to rate this file! 42 Downloads (last 30 days) File Size: 4.4 KB File ID: #38889

Two's Complement Binary Strings

by

 

Convert between binary fixed point two's complement strings and decimal numbers.

| Watch this File

File Information
Description

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.

Required Products MATLAB
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us