AI worksheet builder and 715 free math exercise generators — no subscription or registration required. Optional tips help keep them free. Tip →

Article

Detect Unsigned Carry and Borrow

Go to Math Operation

Detecting unsigned carry and borrow

Unsigned arithmetic works with fixed-size binary numbers. Because the numbers are treated as nonnegative, the result may not fit in the available bits. When that happens, a carry appears in addition or a borrow is needed in subtraction.

1) For addition

  • Add the bits from right to left.
  • If a column sum is 2 or 3, write the low bit and carry 1 to the next column.
  • After the last column, check whether a carry leaves the fixed-size range.

Check: Recompute the sum in decimal or by column work. If the final result needs more bits than allowed, the unsigned result overflowed.

2) For subtraction

  • Subtract from right to left.
  • If a top bit is smaller than the bit below it, borrow 1 from the next column.
  • In unsigned arithmetic, if you must borrow past the most significant bit, the result is not representable in the given width.

Check: Verify by comparing the two values in decimal. If the number being subtracted is larger, an unsigned borrow out of the left side signals underflow.

3) Practical habit

For each exercise, mark every carry or borrow column as you work. Then simplify the final answer by keeping only the bits that fit the fixed width and noting whether an overflow or underflow occurred.

© 2023-2026 AI MATH COACH