Types of complement
r’s and (r-1)’s complement
r’s complement of N
r^n - N
n-no. of integer digits
N-given no.
(r-1)’s complement of N
r^n - N - r^-m
n-no. of integer digits
N-given no.
m-no. of decimal digits
When m=0 , only for nos. with integer digits
r’s complement - 1 = (r-1)’s complement
If we are finding 9’s complement for a no.
we subtract the no. using 999.999 for 9’s complement and then for 10’s complement , we add 1
1’s complement
Flip all bits
2’s complement
Find all 1’s complement and then add 1
F + 1=16
16-16=0 carry goes to prev with 1