You need to design and implement a fu FA tester based on the

You need to design and implement a fu (\"FA\") tester based on the MSP430. Analyze and modify the source code in the next page to produce the FA digital inputs. You can get additional information about the FA in your textbook. In addition, similar information is available about it at the following url http://www.circuitstoday.com/half-adder-and-full-adder and partially included in Figure 1. INPUTS OUTPUTS CIN COUT S FULL ALDER Figure 1. Full adder schematic symbol, circuit, and truth table Figure 2 shows a conceptual schematic of FA tester to be designed and built. Connect one LED to each input and output of the full adder to monitor their values and ensure they follow the FA truth table. Make sure also that LEDs hold their values for about a second before the next values are displayed. FULL MSP430 AIDER Figure 2. The Full adder tester.

Solution

char* addBinary(char* a, char* b) {

int la = strlen(a);

int lb = strlen(b);

int lr = la > lb ? la : lb;

int carry = 0;

char *res = (char*)calloc(lr + 2, sizeof(char));

res[lr + 1] = \'\\0\';

la--; lb--;

while (la >= 0 || lb >= 0) {

   int ba = la >= 0 ? a[la--] - \'0\' : 0;

    int bb = lb >= 0 ? b[lb--] - \'0\' : 0;

    int br = ba ^ bb ^ carry;

    carry = (ba & bb) | (carry & (ba ^ bb));

    res[lr--] = br + \'0\';

}

if (!carry) return res + 1;

res[0] = \'1\';

return res;

}

 You need to design and implement a fu (\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site