# Thread: [Proof] Two's Complement representation is bijective

1. ## [Proof] Two's Complement representation is bijective

Hi there!

I need help with a proof that the Two's Complement's representation is unique -> There are no two representations of a number.

The following formula describes the Two's Complement: $\displaystyle v(a_{n-1}a_{n-2}...a_1a_0) = -a_{n-1}*2^{n-1}+\sum_{i=0}^{n-2}a_i*2^i$,

where $\displaystyle v(a_{n-1}...a_0)$ is the value of the binary number $\displaystyle a_{n-1}...a_0$. n is the number of digits. For example:

$\displaystyle v(10_2) = -1*2^{2-1} + \sum_{i=0}^{2-2}a_i*2^i = -1 * 2^1 + 0*2^0=-2$.
So the $\displaystyle -2$(decimal) is $\displaystyle 10$(binary; one zero, not ten) in the Two's Complement representation.

I tried proving it with a proof by contradiction, but I didn't get very far.
Any help?

BS

2. No one?

I tried to solve it with a proof by contradiction:

$\displaystyle x=-a_{n-1}*2^{n-1}+\sum_{i=0}^{n-2}a_i*2^i=-a_{m-1}*2^{m-1}+\sum_{i=0}^{m-2}b_i*2^i$

$\displaystyle n \neq m$ or $\displaystyle a \neq b$

So I assumed that there are two possible representations of x. Now I have to show that there is a contradiction.

But I have no idea how to do something like that.

Any help?

BS