Binary System with Sigma Summation

423 Views Asked by At

Let 100110101 be a number from the binary system with the digits being $$ b_i \in \left\{0,1\right\} $$ If we calculate this number into the decimal system, the result is 309. What formula can be used to do this kind of calculation?

The answer: $$ \sum_{i=0}^{n-1} b_i2^i $$

Can someone help me understand how this formula can be used for this calculation?

1

There are 1 best solutions below

1
On BEST ANSWER

You gave $B=100110101$ as an example, which amounts to saying: $$ \begin{align} b_0&=1\text{ (least significant digit)}\\ b_1&=0\\ b_2&=1\\ b_3&=0\\ b_4&=1\\ b_5&=1\\ b_6&=0\\ b_7&=0\\ b_5&=1 \end{align} $$ and thus: $$ \begin{align} B&=\sum_{i=0}^{9-1}b_i 2^i\\ &=b_0\cdot 2^0+b_1\cdot 2^1+...+b_8\cdot2^8\\ &=1\cdot 1+0\cdot 2+1\cdot 4+0\cdot 8+1\cdot 16+1\cdot 32+0\cdot 64+0\cdot 128+1\cdot 256\\ &=309 \end{align} $$