I've been studying Karatsuba's algorithm on Wikipedia and I stopped at this section that confused me ..Why is there an overflow in this algorithm , I don't understand the steps he made to resolve this issue .here is a screenshot of my problem

I've been studying Karatsuba's algorithm on Wikipedia and I stopped at this section that confused me ..Why is there an overflow in this algorithm , I don't understand the steps he made to resolve this issue .here is a screenshot of my problem

Let's consider positive numbers only for starter. Let's have 8 bit numbers/digits
x0,x1,y0,y1.When we apply 8 bit multiplication:
It will produce up to 16 bit result. The top value is:
Now if we return to Karatsuba let
Now lets look at the bit width of
ziNote that
z1is 17 bit as top value isSo each of the
zioverflows the 8 bit. To handle that you simply take only the lowest 8 bits and the rest add to higher digit (like propagation of Carry). So:But usually HW implementation of the multiplication handles this on its own and give you result as two words instead of one. See Can't make value propagate through carry
So the result of 16 bit multiplication is 32 bit. Beware that for adding the 8 bit sub results you need at least 10 bits as we are adding 3 numbers together or add and propagate them one by one with 9 bits (or 8 bits + 1 carry).
If you add signed values to this you need another one bit for sign. To avoid it remember signs of operands and use abs values ... and set the sign of result depending on the original signs.
For more details see these: