Converts a binary number to decimal.