Take 123 and -123 for example:
[123] Original code: 01111011. Inverse code: 01111011. Complement code: 01111011.
[-123] Original code: 11111011. Inverse code: 10000100. Complement: 10000101.
The original code, inverse code, and complement code of positive numbers are all equal.
Negative code calculation method:
1. The sign bit remains unchanged.
2. The other bits are negated.
Negative complement method:
1. The sign bit remains unchanged.
2. The other bits are negated.
3. Add 1 to the last digit.