Math Fundamentals18 sections · 814 units
Open in Course

Representing Negative Numbers

Sign magnitude approach

How do you represent negative numbers in binary? One idea: use the leftmost bit as a sign (0 for positive, 1 for negative) and the rest for magnitude.

In 8-bit sign-magnitude, 0000010100000101 is +5+5 and 1000010110000101 is 5-5. Simple, but this has problems: two representations of zero (0000000000000000 and 1000000010000000), and addition circuits get complicated.

Computers do not use sign-magnitude. They use two's complement, which solves both problems: one zero, and addition works without modification. This is the standard representation in all modern CPUs.