Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

#### Two's Complement Wrap-Around

In this section, we give an example showing how temporary overflow in two's complement fixed-point causes no ill effects.

In 3-bit signed fixed-point arithmetic, the available numbers are as shown in Table 9.1.

Table 9.1: Three-bit two's-complement binary fixed-point numbers.
 Decimal Binary -4 100 -3 101 -2 110 -1 111 0 000 1 001 2 010 3 011

Let's perform the sum , which gives a temporary overflow ( , which wraps around to ), but a final result ( ) which is in the allowed range :10.3

Now let's do in three-bit two's complement:

In both examples, the intermediate result overflows, but the final result is correct. Another way to state what happened is that a positive wrap-around in the first addition is canceled by a negative wrap-around in the second addition.

Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]