Conversion between base and base, how to convert between different bases?

Updated on amusement 2024-04-28
6 answers
  1. Anonymous users2024-02-08

    Decimal to binary Convert the number to be converted, divide by 2 to get the quotient and remainder, and continue to divide the quotient by 2 until the quotient is 0. Finally, all the remainders are arranged in reverse order, and the number obtained is the conversion result Binary to decimal For example: 0110 0100=0 * 2 0 + 0 * 2 1 + 1 * 2 2 + 1 * 2 3 + 0 * 2 4 + 1 * 2 5 + 1 * 2 6 + 0 * 2 7 = 100 decimal conversion octal divide the quotient by 8

    Until the quotient is 0, all the remainders are arranged backwards at the end. What you get is the result of the conversion. The decimal conversion to hexadecimal is the same method.

    Octadecimal to Decimal] Such as: 1507 = 7 * 8 0 + 0 * 8 1 + 5 * 8 2 + 1 * 8 3 = 839 Hexadecimal to Decimal Such as: 2af5 = 5 * 16 0 + f * 16 1 + a * 16 2 + 2 * 16 3 = 10997 This is not too difficult, let's study it well.

  2. Anonymous users2024-02-07

    Moving from decimal to decimal is a matter of dividing a number by k and taking the remainder. Converting from k-base to decimal is....I'm sorry, I don't know how to express it

  3. Anonymous users2024-02-06

    Conversion methods between various base systems:

    1. Different carry systems.

    Numbers are converted to decimal system.

    Number: Add by weight.

    The decimal system is weighted to 10; The binary is the right Zheng loss socks are 2; Hexadecimal is weighted to 16; Octal.

    Yes right is 8; Example:

    110011 (binary number.

    1507 (octal number) = 1*8 3 + 5*8 2 + 0*8 1 + 7*8 0 = 839

    2af5 (hexadecimal number.

    2*16^3 + a*16^2+ f*16^1 + 5*16^0 = 10997

    Second, the decimal number is transformed into a different number of radical numbers.

    Integer part: dividing the balance; Decimals: Multiplied to round up.

    Example: Convert a decimal number 13 to a binary number.

    13 2=6 remainder 1

    6 2=3 0

    3 2=1 remainder 1

    1 2=0 remainder 1

    Results: 1101

    3. Binary to octal.

    Turning binary numbers from right to left, in groups of three, is not enough to make up 0

    Example: Binary numbers 10110111011 to octal numbers:

    The result is: 2673

    Fourth, binary conversion.

    Hexadecimal The method of converting binary numbers to hexadecimal numbers is also similar to empty plexus, from right to left, a group of four, not enough to make up 0 as in the above question:

    The result is: 5bb

  4. Anonymous users2024-02-05

    The base conversion algorithm is as follows:

    1. Decimal to binary: the decimal number is divided by 2 to take the remainder, that is, the decimal number is divided by 2, and the remainder is the number of the chain on the weight, and the obtained quotient continues to divide by 2, and this step is until the quotient is 0.

    2. Binary to decimal system: put the binary numbers according to the weight, and add them to get the decimal number.

    3. Binary to octal: 3-digit binary numbers are added to get 1-digit octal numbers according to the weight (note: 3-digit binary to octal is converted from right to left, and 0 is added when insufficient).

    4. Octadecimal to binary: Octal numbers are divided by 2 to take the remainder to get binary numbers, and each octal is 3 binaries, and 0 is added to the far left when it is insufficient.

    5. Binary to hexadecimal: (similar to the method of converting binary to octal) Hexadecimal is rounded off (Note: 4-digit binary to hexadecimal is converted from right to left, and 0 is added when it is insufficient).

    6. Hexadecimal to binary: The hexadecimal number is divided by 2 to take the remainder, and the binary number is called by the wheel, and each hexadecimal system is 4 binaries, and 0 is made up on the far left when it is insufficient.

    7. Octadecimal to decimal system: Weigh the octal numbers and add them together to get the decimal number.

    8. Decimal to octal: Divide the decimal number by 8, press the weight, until the quotient is 0, and then the remaining numbers obtained from the last one to the right are octal numbers.

    9. Hexadecimal to octal: first to binary, and then to octal.

    10. Octadecimal to Hexadecimal: First to binary, and then to octal.

    Other extras:

    Binary: binary(b) is made up of .

    Octal: octal(o) consists of 0-7 (every 8 to 1).

    Decimal(d) is made up of 0-9.

    Hexadecimal: hexadecimal(h) consists of abcdef, corresponding to 10-15.

  5. Anonymous users2024-02-04

    The method of base conversion is:

    Binary numbers, hexadecimal numbers can be converted into decimal numbers by the weight method, and the decimal system to r base system is divided into two parts, in which the integer part is divided by r and the remainder is taken until the quotient is 0, and the decimal part is multiplied by r and the remainder is obtained until the whole number is obtained.

    1. Binary to decimal.

    The value of any binary number is expressed by its bitwise weight.

    For example: Convert a binary number ( to a decimal number.

    2. Convert decimal system to binary.

    Convert decimal integers to binary integers using the "divide by 2 and take the remainder method".

    Divide a decimal integer by 2 to get a quotient and a remainder; Divide the quotient by 2 to get another quotient and a remainder.

    And so on until the quotient is equal to zero.

    The inverted order of the remainder obtained each time is the digit number corresponding to the binary number.

    The result is an inverted arrangement of the remainders, i.e., (37)10 (a5a4a3a2a1a0)2 (100101)2.

    3. Convert decimal decimal places to binary decimals.

    Decimal decimal to binary decimal is converted by "multiplying by 2 to integer". That is, use 2 to multiply the decimal decimal number one by one, and arrange the integer parts of the product obtained each time in the order in which they appear, and the corresponding binary decimal is obtained. To convert decimal decimal to binary decimal decimals, the process is as follows:

    Final Result: (.

    The base system is also the base system, for people who have been in contact with the computer should be no stranger, we commonly use the base system includes: binary, octal, decimal and hexadecimal, the difference between them is that the number is calculated every few decimal digits.

    There are only two digits 0 and 1 in binary numbers, and one digit can be represented by components with two different steady states. For example, the presence or absence of current in a certain path in the circuit, the voltage of a certain node, the conduction and cut-off of transistors, etc. Binary numbers are simple to operate, which greatly simplifies the structure of the arithmetic components in the calculation.

    Carry system Position notation is a way of noting, so it is also known as carry notation Place-value notation, which can represent all numerical values with a limited number of symbols. The number of numeric symbols that can be used is called the base number or base number, and if the base number is n, it can be called the n-base system, referred to as the n-base system. The most commonly used system now is the decimal system, which usually uses 10 Arabic numerals 0-9 for notation.

    For any number, we can use different carry systems to represent it. For example, the decimal number 57 (10) can be expressed in binary as 111001 (2), or in pentatical as 212 (5), or in octal as 71 (8), or in hexadecimal as 39 (16), and they all represent the same value.

  6. Anonymous users2024-02-03

    Conversion between bases:

    1. Decimal to binary.

    The method is: decimal number divided by 2 remainder method, that is, the decimal number is divided by 2, the remainder is the number on the weight, the obtained quotient continues to divide by 2, and this step continues to operate down until the quotient is 0.

    2. Binary to decimal.

    The method is: add the binary numbers according to the weight to get the decimal number.

    3. Binary to octal.

    The method is as follows: 3-digit binary numbers are added to obtain 1-digit octal numbers by adding weights. (Note that the conversion of 3-digit binary to octal is from right to left, and 0 is added when it is insufficient).

    4. Octadecimal to binary.

    The method is: the octal number is divided by 2 to obtain the binary number, and each octal is 3 binaries, and the leftmost zero is added when it is insufficient.

    5. Binary to hexadecimal.

    The method is similar to the binary to octal method, the octal is to take three in one, and the hexadecimal is to take four in one. (Note that the conversion of 4-bit binary to hexadecimal is from right to left, and 0 is added when it is insufficient).

    6. Hexadecimal to binary.

    The method is as follows: the hexadecimal number is divided by 2 to obtain the binary number, and each hexadecimal is 4 binaries, and the leftmost zero is added when it is insufficient.

    The essence of base conversion

    The "number system" is simply a system of symbols to indicate the amount of "quantity" to be referred to. We use the symbol "1" to represent the concept of this "quantity". The "quantity" in nature is infinite, and it is impossible for me to create a symbol for each "quantity", and no one can remember such a system.

    Therefore, it is necessary to use finite symbols to arrange and combine according to a set of laws to represent this infinite "quantity".

    Symbols are finite, and the number of combinations of these symbols according to certain rules is infinite. Decimal is a permutation of 10 symbols, and binary is a permutation of 2 symbols. There is a basic principle when it comes to base conversion:

    The amount of "quantity" expressed after conversion cannot be changed. There are as many 111 apples in binary as there are 7 apples in decimal.

Related questions
9 answers2024-04-28

The decimal number is divisible by other bases, and the resulting remainder is reversed, and the decimal part is multiplied by the other bases until it is an integer. For example, convert the decimal to binary integer part: 24 2=12....0 >>>More

9 answers2024-04-28

#include

using namespace std; >>>More

8 answers2024-04-28

Handwriting conversion.

Divide the decimal number by 16 and keep the remainder. Once you have the remainder, don't divide it further down to get the decimals. >>>More

8 answers2024-04-28

In C, you can use the formatting controller of the printf() function to convert decimal numbers to hexadecimal. Specifically, you can use the %x format controller. For example: >>>More

9 answers2024-04-28

How much is an octal number converted to a hexadecimal number.