Complement explain

Complement two definitions:

  • Positive complement equal to his original code; negative complement equal to the inverted +1
  • Negative complement equal to his original code from low to high, the first ending in '1' and the right '0' remains unchanged, the left you bitwise, the sign bit unchanged.

In fact, the above two paragraphs, then, we are just complement method for finding, rather than complement defined code. Many people think that we must first seek complement negate code, not really.

In fact, positive return to 0, and
so the positive range to the number represented by 1 minus
the original code + = zero complement

Guess you like

Origin www.cnblogs.com/yeni/p/11836520.html