Decimal to binary, in addition to 2 Operations
Decimal 6 to binary is (note from right to left to write, use a formula from bottom to top)
Binary to decimal, multiply by 2 procedure
Binary decimal 0*2 1 - Time Square of 0 Square +1*2 +1*2 's 2 - Time Square =6
Correspondence relationship
0 1 0 1 0 1
32 16 8 4 2 1
Add up the number of 1 corresponding positions, so it's
One byte 1 1 1 1 1 1 1 1 The maximum value is 255
Addition Operation 5 + 4=9, turning into binary operation
1 0 1
+1 0 0
1 0 0 1
Other binary conversions
Octal can be thought of as three bits for one person, for example: 0101 1010
0 0 1 0 1 1 0 1 0
1 3 2 so octal is the
Hexadecimal can be thought of as four bits for one person, for example:
0 1 0 1 1 0 1 0
5 A so hex is 5A
Negative binary binary
An integer account of Eight bytes, binary counter +1 binary
The highest digit of the negative number is 1 .
[Javase] binary conversion (binary decimal hexadecimal octal)