Filter löschen
Filter löschen

Two's complement appear as large positive (decimal) numbers. How do I convert them to the original negative value?

1 Ansicht (letzte 30 Tage)
Signal from my analog-to-digital converter sometimes gives negative (decimal) values, which are taken forward as two's complement numbers. These numbers appear in as large positive (decimal) numbers. I would like to convert them back to the original negative values. I have tried to use codes found from this site, 'twos2dec' but it takes in binary numbers.
The question is:
Why does the two's complement number appear as a large positive decimal in my file (Shouldn't it be in binary form)?
How do I get it back to the original negative value?
I really need help with this one.

Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by