2's complement

From sciforums_encyclopedia
Revision as of 01:03, 21 July 2008 by Skaught (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

a binary system that allows negative numbers in computers.

example

to represent -2 in 2's complement you take the complement of 2 and add 1.
thus 00000010=11111101, adding 1 gives 11111110.
to represent -9, 00001001=11110110, adding 1 gives 11111000.

any carries from the MSB (most significant bit) are ignored.