Convert a Hexadecimal, Octal and Binary Number to Decimal
This tutorial is about how to convert hexadecimal, octal and binary numbers to a decimal number. Before you read this article, you should know what decimal, hexadecimal and those other things are.
Steps
- Binary. First of all, pick a binary number. we will pick 1010110 this time. So first we flip it, it will become 0110101. So now the answer is: <first number> + (<second number> * 2) + (<third number> * (2*2)) + (<fourth number> * (2*2*2)) + (<fifth number> * (2*2*2*2)), etc. So now, we get 0 + (1 * 2) + (1 * (2 * 2)) + (0 * (2 * 2 * 2)) + (1 * (2 * 2 * 2 * 2)) + (0 * (2 * 2 * 2 * 2 * 2)) + (1 * (2 * 2 * 2 * 2 * 2 * 2)) = 86. Also an effective way to do it, is by knowing the following scheme: 001 = 1, 010 = 2, 011 = 3, 100 = 4, 101 = 5, 110 = 6 and 111 = 7. Then you get each three digits from the number, in this case 1, 010 and 110. Then we get the number from each of the pairs of three digits. so we will get 1, 2 and 6. If you combine them together, you will get the same number, but in octal. Cause octal numbers are easier to convert.
- Octal. Converting octal to decimal is very similar to converting binary to decimal. First pick a number. We will have 473 for example. than you flip it, so it will be 374. Then you follow the following scheme: <first number> + (<second number> * 8) + (<third number> * (8 * 8)) + (<fourth number> * (8 * 8 * 8)) etc. So we will have: 3 + (7 * 8) + (4 * (8 * 8)) = 315.
- Hexadecimal. First pick a hexadecimal number. We will have 47D this time. Then you flip it. So we will have D74 now. Then follow the following scheme: <first number> + (<second number> * 16) + (<third number> * (16 * 16) + (<fourth number> * (16 * 16 * 16)) etc. So that we will have 13 + (7 * 16) + (4 * (16 * 16)) = 1149. If you didn't know, D in hexadecimal means 13.