How binary numbers and hexadecimal numbers are converted to each other

Source: Internet
Author: User

    1. 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.
    2. First, let's look at the 16-digit representation, as shown in 1.

    3. 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.

    4. 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.

    5. 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.

    6. 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.

    7. 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.

    8. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.