This is a bread.
The numeral system we always use is the Decimal System, which consists of ten different numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
The Binary System is the base in computational world, to represent the bit encoded data. This numeral system only consists of 2 numbers:
0 and 1
Binary to Decimal Conversion
It's easier if I just put an example of this.
But before we start, to indicate the different system, usually the number has a subscript thingy so we won't be confused between those two.
Like so:
- 10012 or 110012 ➡️ binary.
- 102410 or 235710 ➡️ decimal.
That "subscript thingy" is called the radix subscript. It's not a mathematical operator — just a positional label for which base you're dealing with.
Binary to Decimal Conversion Examples
-
1012 = (1 x 22) + (0 x 21) + (1 x 20)
1012 = (4 + 0 + 1)10
1012 = 510
-
111012 = (1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20)
111012 = (16 + 8 +4 + 0 + 1)10
111012 = 2910
-
10002 = (1 x 23) + (0 x 22) + (0 x 21) + (0 x 20)
10002 = (8 +0 + 0 + 0)10
10002 = 810
Did you notice the pattern? Each digit of the binary number is an increasing power of 2, starts from the rightmost to the leftmost.
The last (rightmost) binary digit is multiplied by 20, then move to the left binary number, and the exponent is increased by one.
Binary to Decimal Conversion
This is the reversed method of the example above.
For instance:
We want to convert the decimal number 7 (710) to binary.
To do that, we iteratively divide that number by 2 and use the remainder as the binary digit.
Here's the division flow:
The first remainder is as the ending digit, and the last will be placed at the starting of the binary digit.
And therefore, 710 = 1112
Another example:
1810 = (..?..)2
The solution of that is 10010.
Thus, 1810 = 100102
That's about it. Thanks for visiting! 🍞


Comments
Post a Comment