I recommend that you start with a simple ripple carry adder so you can check your answers. It will also be helpful to quickly enable debugging output to check that your generates and propagates (see the PDF) are what you expect. Sample output below.

bash-3.2\$ ./cla
Enter A (hex):

1

Enter B (hex):

2

Add (0) or subtract (1): 1

A is 0000000000000001 or 1
B is 0000000000000002 or 2

Inverting 2

B (bin) : 1111111111111111111111111111111111111111111111111111111111111101 Calculate sum, S:

(bin) : 0000000000000000000000000000000000000000000000000000000000000001
(bin) : 1111111111111111111111111111111111111111111111111111111111111101
S (bin) : 1111111111111111111111111111111111111111111111111111111111111111 S is ffffffffffffffff or -1

bash-3.2\$ ./cla Enter A (hex):

1

Enter B (hex):

1

Add (0) or subtract (1): 0

A is 0000000000000001 or 1

B is 0000000000000001 or 1
Calculate sum, S:

(bin) : 0000000000000000000000000000000000000000000000000000000000000001
(bin) : 0000000000000000000000000000000000000000000000000000000000000001
S (bin) : 0000000000000000000000000000000000000000000000000000000000000010 S is 0000000000000002 or 2

bash-3.2\$ ./cla Enter A (hex):

A is 0000000000000001 or                                                     1

B is 0000000000000001 or                                                     1

InvertingB (bin) : 1111111111111111111111111111111111111111111111111111111111111110 Calculate sum, S:                                                                      1

1

Enter B (hex):

1

Add (0) or subtract (1): 1

(bin) : 0000000000000000000000000000000000000000000000000000000000000001
(bin) : 1111111111111111111111111111111111111111111111111111111111111110
S (bin) : 0000000000000000000000000000000000000000000000000000000000000000 S is 0000000000000000 or 0

bash-3.2\$ ./cla Enter A (hex):

15

Enter B (hex):

3

Add (0) or subtract (1): 0

is 0000000000000015 or 21
is 0000000000000003 or 3
Calculate sum, S:

(bin) : 0000000000000000000000000000000000000000000000000000000000010101
(bin) : 0000000000000000000000000000000000000000000000000000000000000011
S (bin) : 0000000000000000000000000000000000000000000000000000000000011000 S is 0000000000000018 or 24

bash-3.2\$ ./cla Enter A (hex):

15

Enter B (hex):

3

Add (0) or subtract (1): 1

is 0000000000000015 or 21
is 0000000000000003 or 3
Inverting 3

B (bin) : 1111111111111111111111111111111111111111111111111111111111111100 Calculate sum, S:

(bin) : 0000000000000000000000000000000000000000000000000000000000010101
(bin) : 1111111111111111111111111111111111111111111111111111111111111100
S (bin) : 0000000000000000000000000000000000000000000000000000000000010010 S is 0000000000000012 or 18

bash-3.2\$ ./cla Enter A (hex): deadbeef Enter B (hex):

123abc

0

A is 00000000deadbeef or 3735928559 B is 0000000000123abc or 1194684

Calculate sum, S:

(bin) : 0000000000000000000000000000000011011110101011011011111011101111
(bin) : 0000000000000000000000000000000000000000000100100011101010111100
S (bin) : 0000000000000000000000000000000011011110101111111111100110101011 S is 00000000debff9ab or 3737123243

bash-3.2\$ ./cla Enter A (hex): deadbeef Enter B (hex):

123abc

1

is 0000000000123abc or 1194684
Inverting 1194684

B (bin) : 1111111111111111111111111111111111111111111011011100010101000011 Calculate sum, S:

(bin) : 0000000000000000000000000000000011011110101011011011111011101111
(bin) : 1111111111111111111111111111111111111111111011011100010101000011
S (bin) : 0000000000000000000000000000000011011110100110111000010000110011 S is 00000000de9b8433 or 3734733875

bash-3.2\$ ./cla Enter A (hex): de1ec7ab1ebeef Enter B (hex):

5ca1ded

0

A is 00de1ec7ab1ebeef or 62521287748009711 B is 0000000005ca1ded or 97132013

Calculate sum, S:

(bin) : 0000000011011110000111101100011110101011000111101011111011101111
(bin) : 0000000000000000000000000000000000000101110010100001110111101101
S (bin) : 0000000011011110000111101100011110110000111010001101110011011100 S is 00de1ec7b0e8dcdc or 62521287845141724

bash-3.2\$ ./cla Enter A (hex): de1ec7ab1ebeef Enter B (hex):

5ca1ded

1

is 00de1ec7ab1ebeef or 62521287748009711
is 0000000005ca1ded or 97132013
Inverting 97132013

B (bin) : 1111111111111111111111111111111111111010001101011110001000010010 Calculate sum, S:

(bin) : 0000000011011110000111101100011110101011000111101011111011101111
(bin) : 1111111111111111111111111111111111111010001101011110001000010010
S (bin) : 0000000011011110000111101100011110100101010101001010000100000010

S is 00de1ec7a554a102 or 62521287650877698