Overflow occurs when the result of a calculation is too large to be stored in the number of available bits. In 8-bit, the maximum positive value is 255 (unsigned) or 127 (signed two's complement). Adding two large numbers can cause overflow — the carry out of the MSB is lost.
11111111 (255)
+ 00000001 (1)
──────────────
1 00000000 ← carry lost! Result appears to be 0 (OVERFLOW)
Binary Shifts
Multiply and Divide by Powers of 2
Left shift: move all bits left by n positions; fill with zeros on right. Equivalent to multiplying by 2ⁿ.
Right shift: move all bits right by n positions; fill with zeros on left. Equivalent to dividing by 2ⁿ (integer division).