internals of a binary to decimal conversion