You do it the same way you do on paper. Start right and move left. if A [i] + B [i] + carry> = 2, the transfer remains 1 and you move on. Otherwise, write A [i] + B [i] + hyphenation and set the hyphenation to 0.
a = "00001"; b = "00010";
carry = 0; a [4] + b [4] + carry = 1, write 1, set carry = 0: 00001
a [3] + b [3] + carry = 1, write 1, set carry = 0: 00011
.