For another example, the binary number 101 is 5 in decimal. The bit on the right is 1 and has a value of 1 (2^0). The middle bit has a value of 2 (2^1 or just 2), but it is a 0, so it is not added. The bit on the left is 1 and has a value of 4 (2^2 or 2 * 2). The bits that are 1s have values of 1 and 4. 1 + 4 = 5.