E.3.1 Signed Binary Numbers And Two’s Complement
So far, we have considered only unsigned binary numbers, which represent non-negative integers in the range 0 to 2n – 1. In many digital systems—particularly in signal processing and communications—it is necessary to represent both positive and negative values. This is achieved using signed number representations.
The most common signed representation in modern digital systems is two’s complement notation. In an n-bit two’s complement system, the most significant bit (MSB) serves as the sign bit: the MSB is “0” for a positive number and “1” for a negative number. The range of values that can therefore be represented is: –2n–1 ≤ x ≤ 2n–1.
For example, an 8-bit signed binary number represents values between –128 and +127. To obtain the two’s complement (negative) of a binary number:
- Invert all bits (form the one’s complement).
- Add 1 to the result.
Example: Represent −5 in 8-bit two’s complement: since 510=00001012, invert the bits to attain 11111010. Then add 1. So, –510=111110112.
Two’s complement representation has the important advantage that addition and subtraction use the same binary adder circuitry as unsigned arithmetic. Overflow is detected when the carry into the sign bit differs from the carry out.
Two’s complement arithmetic is used extensively in digital filters, modulation systems, analog-to-digital converters, and digital signal processors.
Back to reading