Binary to Decimal
Understand Base 2 codes by translating to Base 10 numbers.
The magic of Base 2
If you look at a long number like101101, it is impossible for the human eye to immediately read what value it has. Unlike our Base 10 where the positions are worth Units, Tens, and Hundreds (1, 10, 100), in the Binary world the positions are worth geometric doubles (1, 2, 4, 8, 16, 32...)
Practical example of conversion
Picking up the binaryOne Thousand One Hundred One, we read it from right to left, turning on (1) or off (0) the powers of 2:
- Position 1 (right): the value is 1. Is there '1'? Yes. Add 1.
- Position 2: the value is 2. Is there a '0'? Yes. It doesn't add anything.
- Position 3: the value is 4. Is there a '1'? Yes. Add 4.
- Position 4: the value is 8. Is there a '1'? Yes. Add 8.
Adding the activated values: 8 + 4 + 1 =13. Therefore, the binary 1101 is equivalent to the number 13.