Source: https://www3.nd.edu/~zxu2/acms40390F13/Decimal_binary_convert.pdf