Current location - Training Enrollment Network - Mathematics courses - Some mathematical knowledge
Some mathematical knowledge
Category: Education/Science >> Learning Assistance

Problem description:

I want to know, hexadecimal is converted into decimal, hexadecimal is converted into octal, and hexadecimal is converted into binary; Decimal conversion to hexadecimal, decimal conversion to octal, decimal conversion to binary; Octal to decimal, octal to hexadecimal, octal to binary; Binary to decimal, binary to hexadecimal, binary to octal. Is there any formula? Thank you.

Analysis:

Conversion between decimal number and p number

① Decimal conversion to binary: Decimal integer conversion to binary integer usually adopts the method of dividing by 2 and rounding off the decimal part by 2. For example, (30) 10 is converted into a binary number.

Convert (30) 10 into a binary number.

2 | 30 ...-0- the rightmost position

2 15 …. 1

2 7 …. 1

2 3 …. 1

1 ... 1- leftmost position

∴ (30) 10=( 1 1 1 10)2

Convert (30) 10 into octal and hexadecimal numbers.

8 | 30 ...........................................................................................................................................................................

3- leftmost position

∴ (30) 10 =(36)8

16 | 30 ... 14(e)- the rightmost position

1- leftmost position

∴(30) 10 =( 1e) 16

3. Convert P-ary number into decimal number.

The way to convert binary into decimal is to multiply the last bit of the binary by 20, the penultimate bit by 2 1, ... until the most significant bit is multiplied by 2n, and then the result of product addition is its decimal expression.

Convert binary1110 to decimal.

( 1 1 1 10)2= 1*24+ 1*23+ 1*22+ 1*2 1+0*20=

= 16+8+4+2+0

=(30) 10

The way to convert octal to decimal is to multiply the last digit of octal by 80, the second last digit by 8 1, ... until the highest digit is multiplied by 8n, and then the result of adding all the products is its decimal expression.

Convert octal 36 to decimal.

(36)8=3*8 1+6*80=24+6=(30) 10

The method of converting hexadecimal to decimal is to multiply the last digit of hexadecimal by 160, the second last digit by 16 1, ... until the most significant digit is multiplied by 16n, and then the result of product addition is its decimal expression.

Convert hexadecimal 1E to decimal.

( 1E) 16 = 1 * 16 1+ 14 * 160 = 16+ 14 =(30) 10

3, binary number into octal number

(1) Convert a binary number into an octal number: for integers, divide every three bits of the binary number into a group from low to high; If it is less than three digits, add 0 to the left of high to make up three digits, then replace every three digits of binary number with an octal number, and the decimal part is converted from left to right from decimal point to every three digits. For example:

Convert binary number1101001to octal number, and then

(00 1 10 1 00 1)2

| | |

( 1 5 1)8

( 1 10 100 1)2=( 15 1)8

(2) Converting octal numbers into binary numbers: As long as each octal number is replaced by three binary numbers, the conversion can be completed. For example, if the octal number (643.503)8 is converted into a binary number, then

(6 4 3 .5 0 3)8

| | | | | |

( 1 10 100 0 1 1 . 10 1 000 0 1 1)2

(643.503)8=(***********.***********)2

4. Conversion between binary and hexadecimal

(1) Binary number is converted into hexadecimal number: because the fourth power of 2 = 16, according to the conversion method of binary and octal, binary number is represented by a hexadecimal number every four bits, the integer part is converted from right to left in groups of four bits, and the decimal part is converted from left to right in groups of four bits.

(2) Hexadecimal conversion to binary number

If hexadecimal numbers are converted into binary numbers, the conversion can be completed as long as each hexadecimal number is represented by four corresponding binary numbers.

For example, if (163.5B) 16 is converted to a binary number, then

( 1 6 3 .5 B ) 16

| | | | |

(000 1 0 1 10 00 1 1.0 10 1 10 1 1 )2

( 163.5 b) 16 =(* * * * * * * * * *)。 ***********)2