Yes. There are two methods.
Formally, to convert any number from any base to any other base, simply iteratively divide by that other base, using the rules of arithmetic of the first base, recording remainders in reverse order, until the quotient is zero. For instance, to convert 10111112 to 1378 start by dividing by 10002 and repeating...
10111112 divided by 10002 = 101112 remainder 1112
10112 divided by 10002 = 12 remainder 112
12 divided by 10002 = 02 remainder 12
The answer is 1 (12) 3 (112) 7 (1112)
The second method depends on the fact that 2 and 8 are relative powers of each other, specifically that 8 is 2 to the third power. As a result, you can take the binary bits and group them into groups of three bits and convert them on sight. 10111112 can be rewritten as 12 0112 1112. This, however, is only a trick for a human being; a computer still needs to do the division, but you could use the trick for a computer with a look up table. We also use the trick when converting for hexadecimal, but we cannot use the trick for decimal, because the divisor is 10102, and not just one 1 followed by some number of zeros.
Chat with our AI personalities
1111111010 = octal 1772
To convert an octal number to binary, each octal digit is converted to a group of three binary digits. In this case, the octal number 13.54 is equivalent to 101.101100 in binary. The whole number part (13) is converted to 101, and the fractional part (.54) is converted to 101100.
they are both numbers
Octal numbers are in the range 0 to 7. Since 111 binary is 7 decimal, every three bits in a binary number can be directly converted to a single octal digit. Thus the 9-bit binary number 101011100 can be split into three groups of three bits, 101 011 100, each of which can be converted to octal, 5 3 4, making the octal representation 5348. If a binary number is not an exact multiple of 3 bits, pad with zeroes until it is. Note that all bases that are a power of 2 are directly related to binary. A single base-4 digit represents two binary digits, while a base-8 digit represents three bits, base-16 every four bits, and so on.
The answer depends on what you are converting from: binary, ternary, octal, hexadecimal ...