- The conversion between binary and hexadecimal is similar to the conversion between binary and octal. Let's take a look at it today: first, let's take a look at the mathematical relationship that is 24=16, which is an octal with a four-bit binary representation.
-
First, let's look at the 16-digit representation, as shown in 1.
- 2
to master the corresponding relationship table between the binary number and the hexadecimal number, as shown in 2. Only a firm grasp of the corresponding relationship, in the process of conversion will be more effective.
- 3
Binary conversion to 16 binary method is to take four-in-one method, that is, from the decimal point of the binary point of demarcation, to the left (or to the right) every four bits are taken as a bit, 3 is shown.
- 4
Components are good, compared to the binary and hexadecimal number of the corresponding table (2), the four-bit binary is added by the right, the resulting number is a hexadecimal number, And then in order, the position of the decimal point is not changed oh, and finally get the hexadecimal number Oh, 4.
- 5
Note the notation for 16 notation, denoted by the letter H suffix, for example, BH means 16 binary number 11, or it can be represented by a 0X prefix, For example, 0x23 is 16 binary 23. Visual Representation 5 shows.
- 6
It is important to note that when you take four bits to the left (or right), the highest bit (lowest bit) is not able to fill four bits, You can make 0 on the leftmost (or rightmost) of the decimal point, and the conversion is shown in 6.
- 7
Take a look at the 16 binary into binary, in turn, the method is a point four, that is, a hexadecimal number is divided into four binary numbers, with four-bit binary right add, Finally get binary, the decimal point is still OK. As shown in 7.
How the
binary and hexadecimal numbers are converted to each other