## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

## 3.2 INTEGERS

The most natural way of representing an integer is the sign-magnitude representation system. Nevertheless, it is not the most convenient for executing arithmetic operations. Several representation methods are now described.

### 3.2.1 Sign-Magnitude Representation

Any integer can be represented in the form +x or − x, where x is a natural number. The natural number x can be represented in base B (Theorem 3.1), and instead of using the ‘+’ and ‘−’ symbols, an additional (sign) digit equal to 0 (nonnegative number) or 1 (negative number) is added:

Definition 3.2 The integer represented in the form xn−1 xn−2x1 x0, where xn−1 is the sign bit, is The range of represented numbers is −Bn−1 < x < Bn−1.

Comment 3.2 The number of vectors (xn−1 xn−2x1 x0), where xn−1 is the sign bit, is equal to 2.Bn−1, while the range −Bn−1 < x < Bn−1 only includes 2.Bn−1 − 1 integers. The difference is due to the fact that the vector (100 … 0) does not represent any number (zero is a natural number so that its sign bit should always be equal to 0). Nevertheless, the integer zero could also be accepted with two representations, namely, 000 … 0 (plus zero) and 100 … 0 (minus zero).

### 3.2.2 Excess-E Representation

Another way of representing a negative number x consists in associating a natural number R(x) to x, where R is a one-to-one function, and R(x) is represented in base B.

Definition 3.3

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required