Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Binary conversion

Shulou Source: shulou.com Published: 2022-06-03 03:01:54 10月02日 Update

To convert:

Conversion from binary to decimal

From the lowest bit (rightmost), the number on the bit is multiplied by the weight of the standard, and the weight is the number of digits of 2 minus the power.

Hexadecimal to decimal

From the lowest bit (rightmost), the number on the bit is multiplied by the weight of the standard, and the weight is the number of digits of 6 minus the power.

Octal to decimal

From the lowest bit (rightmost), the number on the bit is multiplied by the weight of the standard, and the weight is the number of digits of 8 minus one power.

Hexadecimal to decimal

From the lowest bit (rightmost), the number on the bit is multiplied by the weight of the standard, and the weight is the number of digits of 16 minus one power.

2. Conversion from decimal to binary:

Main points: divide two to take the rest, arrange in reverse order

Explanation: the decimal number is divided by two, and the resulting quotient is divided by 2. By analogy until the quotient is equal to one or 00:00, the reverse order is the binary result of the conversion.

Decimal to hexadecimal:

When the decimal number is divided by two, the quotient is divided by 6, and by analogy until the quotient is equal to one or 00:00, the reverse order is the binary result of the conversion.

Decimal to octal:

When the decimal number is divided by two, the quotient is divided by 8, and by analogy until the quotient is equal to one or 00:00, the reverse order is the binary result of the conversion.

Decimal to hexadecimal:

When the decimal number is divided by two, the quotient is divided by 16, and by analogy until the quotient is equal to one or 00:00, the reverse order is the binary result of the conversion.

Third, binary to hexadecimal: from right to left, every four digits

Hexadecimal to binary: from right to left, one minute four (one hexadecimal to four binary)

Fourth, binary to octal: from right to left, every three digits

Octal to binary: from right to left, one in three (one octal to three binary)

Tags: Binary decimal decimal weight reverse octal lowest digit hexadecimal that is number result conversion analogy base point explanation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Docker vpn Linux MySQL