Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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.

Réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by