TAOCP 4.1 Exercise 5

A negative integer $-N$ has a nines' complement representation obtained by replacing each decimal digit $d$ of $N$ with $9 - d$.

Section 4.1: Positional Number Systems

Exercise 5. [**] [00] Explain why a negative integer in nines' complement notation has a representation in ten's complement notation that is always one greater, if the representations are regarded as positive.

Verified: yes
Solve time: 1m17s


A negative integer $-N$ has a nines' complement representation obtained by replacing each decimal digit $d$ of $N$ with $9 - d$. In ten's complement notation, the representation is obtained by adding one to the nines' complement of $N$. Therefore, if the nines' complement of $-N$ is regarded as a positive number, the ten's complement representation is exactly one greater than the nines' complement, because the only difference between the two complements is the additional increment of one. This completes the proof.