I need help how to write myAdd functions this is as far I've gone, I know I have to take MSB of both p and q and then call a fullAdder(msb_p, msb_q), and then shift p and q right. and repeat the loop 32 times but I can't put it into code I'm so confused?Code:unsigned int myAdd(unsigned int p, unsigned int q){ unsigned int mySum; /* * loop 32 times * add a pair of bits from p and q, and the previous carry bit * record the sum bit in the corresponding bit in mySum * the first carry bit is zero * the last carry bit is discarded, assuming no overflow */ } int main(){ unsigned int p, q, mySum,i; printf("Enter the 1st integer:\n"); scanf("%d",&p); printf("Enter the second integer:\n"); scanf("%d",&q); printf("Result=%u\n",myAdd(p,q)); return 0; }
Please, someone, help thanks in advance.