As we've seen before, there's a limit to the number of combos we can make with a certain number of bits. That's why there's always a maximum and minimum number we can represent with an n-bit unsigned integer. The minimum is obviously zero since unsigned integers can't get any smaller than that. The maximum would be 2n - 1, where n is the number of bits.
Overflow error occurs when:
- We carry a bit to a digit that doesn't exist
- We borrow a bit from a digit that doesn't exist
In other words, if the result of the operation exceeds our maximum value of 2n - 1 or our minimum value of 0, overflow error occurs (and we probably need to get some more bits).
You've experienced overflow error before! Try typing in particularly large numbers (e.g.999999999999999+9999999999999) in your calculator. Eventually, your calculator will show you the very sad 'Math ERROR'.