1. Known as the 8-bit binary representation of the integer x's complement of 10011011, then-X's complement of the two-step
Encoded as ( 01100101 ).
Parsing: X and-X are known to be opposite to each other, so the complement of X is known, [x] counter = [x] complement-1,
(x is negative)
Then-X (-X is positive) the complement of [-X] complement = [x] anti =-([x] complement-1) =-[x] Complement + 1
First you take the counter, 0 becomes 1, 1 becomes 0. Then the lowest bit plus one.
If you think so:
Given a positive complement, how do you ask for the complement of the opposite number?
Parse: The original, inverse, and complement of positive numbers are the same.
The original code of his inverse number is the modifier sign bit (highest bit),
Anti-code is in addition to the symbol bit, the rest of you bitwise reverse,
Complement is anti-code +1
So, this process is reversed for each bitwise and then added 1
Q: Given the complement of a negative number, how can I ask for the complement of his opposite?
Parsing: That nature is on the process inverse process:
First minus one, in the bitwise reverse
See the process, that is, the bitwise reverse, plus a
x=10011011-x=01100101-2x= (-X left one fill 0, more that bit ignored) 11001010;
x=11001101 (look at X, move right one of the original first is what is now or what); -1/2x=00110010 (by the same token, see-X)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Complement the opposite number of a number