Sign and Magnitude

The most significant bit (MSB) determines if the number is positive (MSB is 0) or negative (MSB is 1). All following bits are the so called magnitude bits. This means that a 8 bit signed integer can represent all numbers from -127 to 127 (\(-2^6\) to \(2^6\)). Except for the MSB, all positive and negative numbers share the same representation.

Visualization of the Sign and Magnitude representation of the decimal number +13.

In the case of a negative number, the only difference is that the first bit (the MSB) is inverted, as shown in the following Scheme.

Visualization of the Sign and Magnitude representation of the decimal number -31

Although this representation seems very intimate and simple, there are multiple consequences and problems that it makes:

  • There are two ways to represent zero, 0000 0000 and 1000 0000.
  • Addition and subtraction require different behaviors depending on the sign bit.
  • Comparisons (e.g. greater, less, ...) also require inspection of the sign bit.

This approach is directly comparable to the common way of showing a sign (placing a "+" or "−" next to the number's magnitude). This kind of representation was only used in early binary computers and was replaced by representations that we will discuss in the following.