Twos complement?


hey guys,

i'm still pretty new @ this. i'm working on accepting data module sends number in 2 bits. i'm told positive or negative according two's complement. while understand concept, have arduino go two-bit two's complement number int?

thanks!

the signed int variables used in arduino uses twos complement negative numbers. convert positive number negative number in twos complement invert bits , add 1.

i think convert 2 bit signed number 16 bit signed number have set 14 higher bits 1 if second bit of smaller number one, not sure.

http://en.wikipedia.org/wiki/twos_complement

lefty



Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Twos complement?


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums