Here is a quick programming trick that I learned to convert binary numbers to decimal. Starting from the most significant bit (MSB) – the one on the extreme left – multiply it by 2 and add the result to the bit to the right, then multiply the new result by 2 and add to the bit to the right, continuing the process untill there are no more bits to process.
Example: 1001010 = 74 1 * 2 + 0 = 2
2 * 2 + 0 = 4
4 * 2 + 1 = 9
9 * 2 + 0 = 18
18 * 2 + 1 = 37
37 * 2 + 0 = 74
Because you double and add to the right, the arithmetic is simple and can be done in your head – no need to go looking for a calculator or conversion tables. Besides you can always impress your friends and fellow programmers with your computer-like brain — maybe –.