Radix Complement Number Systems (3)
Algorithm 1.5 Find [N]r given (N)r .
- First replace each digit, ak , of (N)r by (r - 1) - ak and then add 1 to the resultant.
For binary numbers (r = 2), complement each digit and add 1 to the result.
Example: Find 2’s complement of N = (01100101)2 .
N = 01100101
10011010 Complement the bits
+1 Add 1
[N]2 = (10011011)10
Example: Find 10’s complement of N = (40960)10
N = 40960
59039 Complement the bits
+1 Add 1
[N]2 = (59040)10