One thing we do have to watch out for any time we have a fixed number of bits to represent numbers is
overflow. That is when a value becomes too large to store in the bits we have. When we are doing math on paper, we can add as many digits as we need. But when an electric circuit is doing math, there is a fixed number of digits that can be represented. For example, say we are using 4-bit numbers and we try to add 9 + 9 (
+
) - any bits past 4 need to be discarded.
9 + 9 gave us just 2 because we can not store the bit that should represent 16. This is an overflow error. Circuits in computers have to detect when there is a carry-out of the last digit so it can signal an error and software developers have to be careful to watch for these errors. Computers use many more than 4 bits to store each number, but any fixed representation will have limits to how big a value can be stored.
Real software can have bugs when the developers do not use enough bits to represent numbers. Youtube engineers had to
add more bits to the storage for view counts of the video Gangnam Style when the view counter for the video was threatening to overflow the 32 bits they had originally used.