Carry count system and its conversion method process

First, what is the carry count system?

The number system, also known as the counting system, refers to a method of representing values ​​using a fixed set of symbols and uniform rules. The method of counting according to the principle of carry is called the carry count system. For example, in the decimal counting system, it is counted according to the principle of “ten every ten in one”.

Common carry count system:

1, Decimal notation, there are 10 bases: 0 ~ ~ 9, every ten into one;

2, Binary notation, there are 2 bases: 0 ~ ~ 1 , every two into one;

3, octal (Octal notation), there are 8 bases: 0 ~ ~ 7, every eight into one;

4, Hexdecimal notation, there are 16 bases: 0 ~ ~ 9, A, B, C, D, E, F (A = 10, B = 11, C = 12, D = 13, E=14, F=15), every sixteen into one.

Second, the cardinality and bit weight of the carry count system

"Base" and "bit" are two elements of the carry count system.

1, cardinality:

The so-called cardinality is the number of digits that may be present on each digit of the carry count system. For example, the number on each digit of the decimal number has "0", "1", "3", ..., "9" ten digits, so the base is 10.

2, the right:

The so-called bit weight refers to the weight of the number on each digit of a value. For example, the decimal number 4567 has a bit weight of 100, 101, 102, and 103 from the low to the high. because:

4567=4x103+5x 102+6x 101 +7x100

3. The weight of the number indicates:

Any number of numbers can be expressed as the sum of polynomials developed by bitwise weight.

For example: 435.05 of the decimal number can be expressed as:

435.05=4x102+3x 101+5x100+0x10-1 +5x 10-2

The characteristics of the bit weight notation are: each term = several powers of the number X base of a certain bit; and the size of the power is determined by the position of the number.

Third, the binary number

Why binary is used in computers: binary operation is simple, circuit is simple and reliable, and logic is strong.

1. Definition:

According to the principle of “every two into one”, it is called a binary number, that is, each bit is counted up to 2 when it is full.

2. Features:

Each digit can only be 0, 1 two digits; the largest digit in the binary number is 1, the smallest digit is 0; the base is 2;

For example, with 00101011 is two binary numbers.

3. The bit weight representation of the binary number:

(1101.101)2=1x23+1x 22+0x 21+1x 20+1x2-1 +0x 2-2+1x2-3

4, the operation rules of binary numbers:

Addition

1 0+0=0 3 1+1=10

2 0+1=1+0=1

Multiplication

1 0×0=0 3 1×1=1

2 0×1=1×0=0

Four, octal number

1. Definition:

According to the principle of “every eight into one”, it is called octal number, that is, each digit is advanced to 8 when it is full.

2. Features:

The number of each number can only be 0, 1, 2, 3, 4, 5, 6, 7 eight numbers; the largest number in octal number is 7, the smallest number is 0; the base is 8;

For example: (1347) 8 and (62435) 8 are two octal numbers.

3. The bit weight representation of the octal number:

(107.13) 8=1x 82+0x 81+7x 80+1x8-1 +3x 8-2

Five, hexadecimal number

1. Definition:

According to the principle of “every sixteen into one”, it is called hexadecimal number, that is, each bit is counted up to 16 when it is full.

2. Features:

The number of each digit can only be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F sixteen digits; hexadecimal number The largest number in the middle is F, which is 15, the smallest number is 0; the base is 16;

For example: (109)16 and (2FDE)16 are two hexadecimal numbers.

3. The bit weight representation of the hexadecimal number:

(109.13)16=1x 162+0x161+9x 160+1x16-1 +3x 16-2

(2FDE)16=2x 163+15x 162+13x 161+14x 160

6. Correspondence between commonly used counting systems

Binary numbers, octal numbers, hexadecimal numbers and decimal numbers are four kinds of numbers commonly used in modern digital systems. The correspondence between these counting systems is listed in Table 1.

Table 1 Representation of common counting systems

Decimal Binary number Octal number Hexadecimal number
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
17 10001 twenty one 11
18 10010 twenty two 12
19 10011 twenty three 13
20 10100 twenty four 14
32 100000 40 20
50 110010 62 32
60 111100 74 3C
64 1000000 100 40
100 1100100 144 64
255 11111111 377 FF
1000 1111101000 1750 3E8

Seven, the conversion between the number system

1, the decimal number is converted to a non-decimal number

(1) Convert decimal integers to non-decimal integers

1 Why do you want to convert between numbers?

Converting a number from one number system to another is called a conversion between numbers.

Because the decimal number is often used in daily life, and the binary number is used in the computer. Therefore, when using a computer, you must convert the input decimal number to a binary number that the computer can accept. After the computer finishes running, it converts the binary number into the decimal number output that people are accustomed to. These two conversion processes are completely automated by the computer.

2 conversion method

The decimal integer is converted to a non-decimal integer using the "residual method", that is, the remainder is divided by the base.

The decimal integer is successively removed by the base of any ten system, until the quotient is 0, and then the resulting remainder is arranged from bottom to top.

2 decimal decimal conversion to non-decimal decimal conversion method

The decimal fraction is converted to a non-decimal fraction using the "carry method", that is, the base is taken as an integer.

The decimal fraction is continuously multiplied by the base of the other hexadecimal, until the current value of the decimal is equal to 0 or the required precision is satisfied, and the integer part of the obtained product is arranged from top to bottom.

2. Convert non-decimal numbers to decimal numbers

The conversion of non-decimal numbers into ten systems uses the "bit weight method", that is, the non-decimal numbers are expanded by bitwise and then summed.

3, conversion between two, eight, and decimal numbers

(1) Conversion conversion method between binary numbers and octal numbers

When converting a binary number to an octal number, press the "three digits and one digit" method.

With the decimal point as the boundary, the integer part is from right to left every three-digit group. When the highest position is less than three digits, add 0 to make up three digits; the decimal part is from left to right, every three digits, and the least significant digit is less than three digits. When you add 0 to make up three. Then, the three-digit binary numbers of each group are expanded by weight and added to obtain an octal number.

2 When converting an octal number to a binary number, use the method of "one-bit three-bit".

That is, the number on each bit of the octal number is represented by the corresponding three-digit binary number.

Conversion conversion method between 3 binary numbers and hexadecimal numbers

a. When converting a binary number to a hexadecimal number, press the method of "four bits and one bit".

With the decimal point as the boundary, the integer part is from right to left every four-digit group. When the highest position is less than four digits, add 0 to make up four digits; the decimal part is from left to right, and each four-digit minimum effective digit is less than four digits. Add 0 to make up four. Then, the four-digit binary numbers of each group are expanded by weight and added to obtain a hexadecimal number.

b. When converting a hexadecimal number into a binary number, use the method of “one bit split four bits”.

That is, the number on each bit of the hexadecimal number is represented by the corresponding four-digit binary number.

Wireless earphones

Dongguan Guancheng Precision Plastic Manufacturing Co., Ltd. , https://www.dpowergo.com