Old computers often had a "carry flag" specifically to make this easier e.g.on Arm:
add r0,r0,#1 adc r1,r1,#0
addi a0,a0,1 sltiu t1,a0,1 # set to 1 if a0 wrapped back to 0 add a1,a1,t1
Old computers often had a "carry flag" specifically to make this easier e.g.on Arm:
But even on RISC-V, often criticised for not having a carry flag, it's not hard: