Hexadecimal number system to binary number system. Binary octal hexadecimal number system


Purpose of the service. The service is designed to convert numbers from one number system to another in online mode. To do this, select the base of the system from which you want to convert the number. You can enter both integers and numbers with commas.

Number

Conversion from 10 2 8 16 number system. Convert to 2 10 8 16 number system.
For fractional numbers use 2 3 4 5 6 7 8 decimal places.

You can enter both whole numbers, for example 34, and fractional numbers, for example, 637.333. For fractional numbers, the translation accuracy after the decimal point is indicated.

The following are also used with this calculator:

Ways to represent numbers

Binary (binary) numbers - each digit means the value of one bit (0 or 1), the most significant bit is always written on the left, the letter “b” is placed after the number. For ease of perception, notebooks can be separated by spaces. For example, 1010 0101b.
Hexadecimal (hexadecimal) numbers - each tetrad is represented by one symbol 0...9, A, B, ..., F. This representation can be designated in different ways; here only the symbol “h” is used after the last hexadecimal digit. For example, A5h. In program texts, the same number can be designated as either 0xA5 or 0A5h, depending on the syntax of the programming language. A leading zero (0) is added to the left of the most significant hexadecimal digit represented by the letter to distinguish between numbers and symbolic names.
Decimal (decimal) numbers - each byte (word, double word) is represented by a regular number, and the decimal representation sign (the letter “d”) is usually omitted. The byte in the previous examples has a decimal value of 165. Unlike binary and hexadecimal notation, decimal is difficult to mentally determine the value of each bit, which is sometimes necessary.
Octal (octal) numbers - each triple of bits (division starts from the least significant) is written as a number 0–7, with an “o” at the end. The same number would be written as 245o. The octal system is inconvenient because the byte cannot be divided equally.

Algorithm for converting numbers from one number system to another

Translation of integers decimal numbers to any other number system is carried out by dividing the number by the base new system numbering until the remainder remains a number smaller than the base of the new number system. The new number is written as division remainders, starting from the last one.
Converting a correct decimal fraction to another PSS is carried out by multiplying only the fractional part of the number by the base of the new number system until all zeros remain in the fractional part or until it reaches specified accuracy translation. As a result of each multiplication operation, one digit of a new number is formed, starting with the highest one.
Improper fraction translation is carried out according to rules 1 and 2. Kisses and fractional part written together, separated by a comma.

Example No. 1.



Conversion from 2 to 8 to 16 number system.
These systems are multiples of two, therefore the translation is carried out using a correspondence table (see below).

To convert a number from the binary number system to the octal (hexadecimal) number system, it is necessary to divide the binary number from the decimal point to the right and left into groups of three (four for hexadecimal) digits, supplementing the outer groups with zeros if necessary. Each group is replaced by the corresponding octal or hexadecimal digit.

Example No. 2. 1010111010.1011 = 1.010.111.010.101.1 = 1272.51 8
here 001=1; 010=2; 111=7; 010=2; 101=5; 001=1

When converting to the hexadecimal system, you must divide the number into parts of four digits, following the same rules.
Example No. 3. 1010111010,1011 = 10.1011.1010,1011 = 2B12,13 HEX
here 0010=2; 1011=B; 1010=12; 1011=13

Converting numbers from 2, 8 and 16 to decimal system calculations are made by dividing a number into individual ones and multiplying it by the base of the system (from which the number is translated) raised to the power corresponding to it serial number in the translated number. In this case, the numbers are numbered to the left of the decimal point (the first number is numbered 0) with increasing, and to the right with decreasing (i.e., with a negative sign). The results obtained are added up.

Example No. 4.
An example of conversion from binary to decimal number system.

1010010.101 2 = 1·2 6 +0·2 5 +1·2 4 +0·2 3 +0·2 2 +1·2 1 +0·2 0 + 1·2 -1 +0·2 - 2 +1 2 -3 =
= 64+0+16+0+0+2+0+0.5+0+0.125 = 82.625 10 An example of conversion from octal to decimal number system. 108.5 8 = 1*·8 2 +0·8 1 +8·8 0 + 5·8 -1 = 64+0+8+0.625 = 72.625 10 An example of conversion from hexadecimal to decimal number system. 108.5 16 = 1·16 2 +0·16 1 +8·16 0 + 5·16 -1 = 256+0+8+0.3125 = 264.3125 10

Once again we repeat the algorithm for converting numbers from one number system to another PSS

  1. From the decimal number system:
    • divide the number by the base of the number system being translated;
    • find the remainder when dividing an integer part of a number;
    • write down all remainders from division in reverse order;
  2. From the binary number system
    • To convert to the decimal number system, it is necessary to find the sum of the products of base 2 by the corresponding degree of digit;
    • To convert a number to octal, you need to break the number into triads.
      For example, 1000110 = 1,000 110 = 106 8
    • To convert a number from binary to hexadecimal, you need to divide the number into groups of 4 digits.
      For example, 1000110 = 100 0110 = 46 16
The system is called positional, for which the significance or weight of a digit depends on its location in the number. The relationship between the systems is expressed in a table.
Number system correspondence table:
Binary SSHexadecimal SS
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

Table for conversion to octal number system

To represent numbers in a microprocessor it is used binary number system.
Moreover, any digital signal can have two stable states: " high level" And " low level" In the binary number system, any number is represented by two digits, respectively: 0 and 1. Arbitrary number x=a n a n-1 ..a 1 a 0 ,a -1 a -2 …a -m will be written in binary number system as

x = a n ·2 n +a n-1 ·2 n-1 +…+a 1 ·2 1 +a 0 ·2 0 +a -1 ·2 -1 +a -2 ·2 -2 +…+a -m ·2 -m

Where a ibinary digits(0 or 1).

Octal number system

IN octal system In numbering, the basic digits are numbers from 0 to 7. 8 units of the lower digit are combined into a unit of the highest digit.

Hexadecimal number system

In the hexadecimal number system, the base digits are the numbers from 0 to 15 inclusive. To designate base digits greater than 9 with one symbol, in addition to the Arabic numerals 0...9 in the hexadecimal number system, letters of the Latin alphabet are used:

10 10 = A 16 12 10 = C 16 14 10 = E 16
11 10 = B 16 13 10 = D 16 15 10 = F 16.

For example, the number 175 10 in hexadecimal number system will be written as AF 16. Really,

10·16 1 +15·16 0 =160+15=175

The table shows numbers from 0 to 16 in decimal, binary, octal and hexadecimal number systems.

Decimal Binary Octal Hexadecimal
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

Binary-octal and binary-hexadecimal conversions

The binary number system is convenient for performing arithmetic operations using microprocessor hardware, but is inconvenient for human perception because it requires large quantity discharges. Therefore in computer technology in addition to the binary number system, octal and hexadecimal system Numbers for a more compact representation of numbers.

Three digits of the octal number system implement everything possible combinations octal digits in the binary number system: from 0 (000) to 7 (111). To convert a binary number to octal, you need to combine the binary digits into groups of 3 digits (triads) in two directions, starting from the decimal separator. If necessary, you need to add insignificant zeros to the left of the original number. If a number contains a fractional part, then to the right of it you can also add insignificant zeros until all triads are filled. Each triad is then replaced by an octal digit.

Example: Convert the number 1101110.01 2 to octal number system.

We combine binary digits into triads from right to left. We get

001 101 110,010 2 = 156,2 8 .

To convert a number from octal to binary, you need to write each octal digit in binary code:

156,2 8 = 001 101 110,010 2 .

The four digits of the hexadecimal number system implement all possible combinations of hexadecimal digits in the binary number system: from 0 (0000) to F(1111). To convert a binary number to hexadecimal, you need to combine the binary digits into groups of 4 digits (tetrads) in two directions, starting from the decimal separator. If necessary, you need to add insignificant zeros to the left of the original number. If the number contains a fractional part, then to the right of it you also need to add insignificant zeros until all notebooks are filled. Each tetrad is then replaced with a hexadecimal digit.

Example: Convert the number 1101110.11 2 to hexadecimal number system.

We combine binary digits into tetrads from right to left. We get

0110 1110.1100 2 = 6E,C 16 .

To convert a number from hexadecimal to binary, you need to write each hexadecimal digit in binary code.

Originated in ancient Babylon. In India, the system works in the form of positional decimal numbering using zero, among Hindus this system numbers were borrowed by the Arab nation, and the Europeans, in turn, took them from them. In Europe, this system began to be called Arabic.

Positional systemdead reckoning— the meaning of all digits depends on the position (digit) of the given digit in the number.

Examples, the standard decimal number system is a positional system. Let's say given a number453 . Number 4 stands for hundreds and corresponds to a number400, 5 - number of tens and corresponds to the value50 , A 3 - units and meaning3 . It is easy to see that as the digit increases, the value increases. Thus, we write the given number as a sum400+50+3=453.

Hexadecimal number system.

Hexadecimal number system(hexadecimal numbers) - positional number system. Hexadecimal base is the number 16.

Writing numbers in octal number system we get quite compact expressions, but in hexadecimal we get more compact expressions.

The first ten digits of the sixteen hexadecimal digits are the standard spacing 0 - 9 , the next six digits are expressed using the first letters of the Latin alphabet: A, B, C, D, E, F. Convert from hexadecimal to binary system and in reverse side do the same process for the octal system.

Application of the hexadecimal number system.

The hexadecimal number system is used quite well in modern computers, For example use it to indicate color: #FFFFFF- White color.

Converting numbers from one number system to another.

Converting numbers from hexadecimal to decimal.

To translate hexadecimal number V decimal, you need to reduce the given number to the form of the sum of the products of the powers of the base of the hexadecimal number system by the corresponding digits in the digits of the hexadecimal number.

For example, convert the hexadecimal number 5A3 to decimal. Here 3 numbers. Based on the above rule, we reduce it to the form of a sum of powers with a base of 16:

5A3 16 = 3·16 0 +10·16 1 +5·16 2 = 3·1+10·16+5·256 = 3+160+1280 = 1443 10

Converting numbers from binary to hexadecimal and vice versa.

To translate polysemantic binary number in the hexadecimal system, you need to divide it into tetrads from right to left and replace all tetrads with the corresponding hexadecimal digit. To convert a number from the hexadecimal system to the binary system, you need to change each digit to the corresponding tetrads from the conversion table, which you will find below.

For example:

010110100011 2 = 0101 1010 0011 = 5A3 16

Number conversion table.

An algorithm for converting numbers from one number system to another.

1. From the decimal number system:

  • divide the number by the base of the translated number system;
  • find the remainder when dividing the integer part of a number;
  • write down all remainders from division in reverse order;

2. From the binary number system:

  • to convert to the decimal number system, we find the sum of the products of base 2 by the corresponding degree of digit;
  • To convert a number to octal, we divide the number into triads.

For example, 1000110 = 1,000,110 = 1068

  • To convert a number from the binary number system to hexadecimal, we divide the number into groups of 4 digits.

For example, 1000110 = 100 0110 = 4616.

Translation tables:

Binary SS

Hexadecimal SS

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

Binary SS







2024 gtavrl.ru.