Computer Arithmetic: Addition and Subtraction in Binary, Octal, and Hexadecimal
·4718 words·23 mins
The addition and subtraction rules of base 10 hold in any base: only the value that triggers the carry changes. We do arithmetic in binary, octal, and hexadecimal, see why with three addends the carry can be worth 2, and implement both algorithms in Python.