Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL
by Mohammed Ferdjallah
2.6 BINARY ARITHMETIC
2.6.1 Addition of Unsigned Numbers
Numbers that are always considered to be positive are designated unsigned numbers; numbers that can take up negative values are designated signed numbers. An addition operation using unsigned numbers is carried out pretty much like a decimal addition process. The only difference is that in binary arithmetic we use only two digits: 0 and 1. The following examples illustrate the four basic results of adding only 2 bits.


Figure 2.5 Sign Contraction
The following examples illustrate the addition of unsigned binary numbers. Decimal addition was included for arithmetic verification.

Note that the result of the second example has 5 bits instead of 4. Therefore, we must be careful when dealing with binary arithmetic for large numbers. When implemented in circuits that have fixed number lengths, the last bit will be considered the overflow. When adding unsigned binary numbers, the resulting sum may be larger than the size of the internal registers of the digital system.
2.6.2 Subtraction of Unsigned Numbers
The subtraction operation is performed as an addition operation using the two's-complement method. When subtracting unsigned ...