Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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.

Respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by