One's complement binary calculator

Input binary number:
Inverse code:

The original code is a binary fixed-point representation, that is, the highest bit is the sign bit, "0" represents positive, "1" represents negative, and the remaining bits represent the size of the value.

The inverse code: The inverse code of a positive number is the same as its original code; the inverse code of a negative number is the inverse of its original code bit by bit, except for the sign bit. The complement code: The complement code of a positive number is the same as its original code; the complement code of a negative number is to add 1 to the last bit of its complement code.