Basic concepts
Original code, anti-code, complement just remember these words is enough
1. The highest bit of binary is the sign bit: 0 for positive, 1 for negative
2. Positive source code, anti-code, complement all the same
3. Negative number of the anti-code = Its original code sign bit is unchanged, the other bits take the reverse
4. The complement of negative number = Its anti-code +1
5.0 of the counter code, the complement is 0
The numbers in 6.java are signed.
7 in the computer operation, are all in the form of a complement of the operation
8 The complement is reversed (the high is 1 to take the counter), the high must also take counter
The opposite is called
2&3 called with
2|3 called or
2^3 is called XOR or
1>>2 called arithmetic right shift low overflow, sign bit invariant, and sign bit to fill overflow high
1<<2 called arithmetic left shift sign bit unchanged, low fill 0
1>>>2 is called logical right shift low overflow, high fill 0
My Java operator understands that