notes
Converting a given binary number to its 2's complement form
- Step 1 → -x = x' + 1 where x' is the one's complement of x.
- Step 2 → Extend the data width of the number, fill up with sign extension i.e. MSB bit
is used to fill the bits.
- Example : -47 decimal over 8bit representation
- Binary equivalent of + 47 is 0010 1111
- Binary equivalent of - 47 is 1010 1111 (Sign Magnitude Form)
- 1's complement equivalent is 1101 0000
- 2’s complement equivalent is 1101 0001
- As you can see zero is not getting represented with redundance.
- There is only one way of representing zero.
- The other problem of the comlexity of the arithmetic operation is also eliminated in 2's complement representation.
- Subraction is done as Addition.