Sources for http://howtowriteaprogram.blogspot.com/2013/05/binary-to-decimal-conversion-how-hard.html