Slide 3.5: Hexadecimal integers Slide 3.7: Signed integers (cont.) Home |
Negative Integer: (-26)10 = | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
Positive Integer: (38)10 = | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 |
The two's complement of a positive number N in base r with n digits is rn - N for N <> 0 and 0 for N = 0.Two's complement representation is useful to processor designers because a single digital circuit can handle both addition and subtraction. The following two steps can also be used to find the two's complement of a binary integer. The two's complement operation is reversible.