Binary number in the decimal system, convert - how to
Computer arithmetic mostly with binary numbers, respectively a dual system. There are only two Numbers: 0 and 1. These are computers, representing "on" and "off".
- We take as a first example, the number "101010", which you want to convert in the normal decimal system ("the decimal system").
- For this, you start to count from the right to the far right is a 0, so write down "0 ⋅ 2⁰".
- Next, take the number, which is a position further to the left, and add the Whole to your result: "0 ⋅ 2⁰ + 1 ⋅ 21". The more a number of of the number is quite far to the right, the greater the potency.
- Now repeat these steps for all the Numbers. As a result, you should now receive a "0 ⋅ 2⁰+ 1 ⋅ 21 + 0 ⋅ 22 + 1 ⋅ 23 + 0 ⋅ 2⁴ + 1 ⋅ 2⁵".
- You can then convert the powers into normal integers: "0 ⋅ 1 + 1 ⋅ 2 + 0 ⋅ 4 + 1 ⋅ 8 + 0 ⋅ 16 + 1 ⋅ 32".
- Ironically, the number "101010" in the binary system in the decimal system, the number "42".
- Tip: If this calculation method is too difficult, you can memorize the table that you see in the above picture.

Binary number into decimal number how to
Decimal number to binary number to convert
A ten number to a binary number to convert is even easier, as a binary number to a decimal number to be converted.
- In this example, we again use the number "42".
- Divide this number by 2: "42 : 2 = 21 remainder 0".
- Then, the result of the previous statement by 2: "21 : 2 = 10 remainder 1".
- Repeat these steps several times until you come to the statement "0 : 2 = 0 remainder 0". From here, the same result would always; you can stop with the invoice.
- The invoice should look similar to the following to you now: "42 : 2 = 21 remainder 0; 21 : 2 = 10 remainder 1; 10 : 2 = 5 remainder 0; 5 : 2 = 2 remainder 1; 2 : 2 = 1 remainder 0; 1 : 2 = 0 Rest 1; 0 : 2 = 0 remainder 0; ...
- Write down now the Rest of each invoice. You start from the back. You should now get the number of "0101010".
- Finally, you need to omit only, all zeros until the first 1. The number "42" is in the dual system, the number "101010".

Decimal number to binary number to convert
Decimal number to convert to hexadecimal system how to
A bit more complicated is the Conversion of a number in the hexadecimal system.
- As an example, we use this time the number "2017".
- Divide this number by 16 and note the remainder: "2017 : 16 = 126 residual 1".
- Now you need to the result of the previous bill by 16 parts: "126 : 16 = 7 remainder 14".
- Repeat the steps until you have reached the bill "0 : 16 = 0 remainder 0".
- Your invoice should now look like the following: "2017 : 16 = 126 Rest 1; 126 : 16 = 7 remainder 14; 7 : 16 = 0 remainder 7; 0 : 16 = 0 remainder 0; ...
- Here, too, you need to write down, such as when you Convert to the dual system, the Rest of each invoice from the rear to the front in a row. However, there are the hexadecimal system 16 digits. The Numbers 0 through 9 remain the same. If there is a residual, however, should be greater than 9, you need to convert this in a letter. Here, 10 = applies: "A; 11 = B; 12 = C; 13 = D; 14 = E; 15 = F".
- If you need to record the remains, you should come to the number "07E1". Here, too, you can omit the zeros at the beginning. The number "2017" in the hexadecimal system, the number of "7E1".
- Tip: you can quickly calculate the residue, it is sufficient if the Numbers of a quotient after the decimal point with 16 multiply: "126 : 7 = 7,875 → 126 : 7 = 7 Rest (16 ⋅ 0,875) → 126 : 7 = 7 Rest 14".

Decimal to Hexadecimal
Hexadecimal number convert into normal decimal number
To Convert a hexadecimal number to normal decimal number works in a similar way as the Conversion of a binary number.
- As an example, we use the hexadecimal number is "MONKEY". As you already know, the "A" for 10, the "F" for 15 and "E" for a 14.
- You start on the right with the Count, and write "14 ⋅ 16⁰".
- Now go one position further to the left, and add the Whole to your result: "14 ⋅ 16⁰ + 15 ⋅ 161". As you can see, the invoice, similar to the Conversion of a binary number.
- At the end of your invoice should look like the following: "14 ⋅ 16⁰+ 15 ⋅ 161 + 15 ⋅ 162 + 10 ⋅ 163". As a result, you get "45054".

Hexadecimal number conversion - how to
Hexadecimal into binary and Vice versa
In the next paragraph, we would like to show you finally how you can convert a hexadecimal number into a binary number and Vice versa.
- As you may know, can be represented 16 different Numbers with exactly 4 digits in the dual system, because 2⁴ = 16.
- You will split the binary number of your choice in four parcels: "1010 1111 1111 1110"
- Then you can convert each four-pack in a decimal number, to the appropriate hexadecimal number easier to assign.
- Vice versa, you can convert each digit of a hexadecimal number into a binary number.

Hexadecimal to binary number conversion
0x and 0b - for what?
You probably have noticed already, that some of hexadecimal or binary numbers with "0x" or "0b" is numbers.
- The "0x" is sometimes made of a hexadecimal number, so that this is also recognized as a hexadecimal number.
- Before the binary is written, for example, often "0b".
- The "x" in the "0x" stands for the "x" in "Hexadecimal", the "b", "0b" for "binary number".
- So that you can distinguish the Numbers better, the brackets (in mathematics) to set: "(MONKEY)₁₆". The 16 in the Index stands for the hexadecimal system. Numbers in the dual system are therefore indicated with "(101010)₂".
As with the programming language "Python" Arrays create and use can be learned in the next tip.
