Binary and hexadecimal comparison table:
Binary system rules: even numbers have a mantissa of 0, and odd numbers have a mantissa of 1; the Nth power of 2, from right to left, the number of digits in power 1 is 1, and the subsequent digits are 0; for example, 4 is the 2nd power of 2 Then it is 0100
The method of converting binary to hexadecimal is to use the four-in-one method, that is, starting from the binary decimal point as the dividing point, every four digits to the left (or right) are taken into one digit.
Convert hexadecimal to binary, and vice versa. The method is to divide one hexadecimal number into four binary numbers, and add the four binary digits according to the weight, and finally get the binary number and decimal point. It's still fine.
Binary |
Hex | binary | hex | binary |
hex | binary | Hex |
---|---|---|---|---|---|---|---|
0x01 (1) | 0101 | 0x05 (5) | 1001 | 0x09 (9) | 1101 | 0x0D (D) | |
0x02 (2) | 0110 | 0x06 (6) | 1010 | 0x0A (A) | 1110 | 0x0E (E) | ##0011 |
0111 | 0x07 (7) | 1011 | 0x0B (B) | 1111 | 0x0F (F) | 0100 | |
1000 | 0x08 (8) | 1100 | 0x0C (C) |
The above is the detailed content of Binary hexadecimal comparison table. For more information, please follow other related articles on the PHP Chinese website!