Integer Formats
Sign-Magnitude Representation (Original Binary Data)
To represent a singed decimal number in binary format, it uses the highest bit as sign bit to determine whether the binary number is negative.
stands for positive number and means negative number.
One’s Complements (Radix-1 Complements)
- Positive Number: Same as original.
- Negative Number: Inverse all bits except the sign bit of a binary number.
Two’s Complements (Radix Complements)
- Positive Number: Same as original.
- Negative Number: Plus on one’s complements.
Range of Representation
Suppose the data has bits.
Both sign-magnitude representation and one’s complements have and , so the range is
While two’s complements has only one , so the range is
In conclusion:
| Representation | Range |
|---|---|
| Sign-Magnitude Representation | |
| One’s Complements | |
| Two’s Complements |
Application of Two’s Complements
When doing subtraction, like calculating , it can be converted to calculating , where is generated by its two’s complements.
Last updated on