void setup() {  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
Digital InputBreakout
Extra Credit: 4-bit Full-Adder with Carry
A0
A1
Cin
Computes A1A0 + B1B0 + Cin = S2S1S0
Truth Table
--------------
Cin A1 A0 B1 B0 | S2 S1 S0
------------------------------
0 0 0 0 0 | 0 0 0
0 0 0 0 1 | 0 0 1
0 0 0 1 0 | 0 1 0
0 0 0 1 1 | 0 1 1
0 0 1 0 0 | 0 0 1
0 0 1 0 1 | 0 1 0
0 0 1 1 0 | 0 1 1
0 0 1 1 1 | 1 0 0
0 1 0 0 0 | 0 1 0
0 1 0 0 1 | 0 1 1
0 1 0 1 0 | 1 0 0
0 1 0 1 1 | 1 0 1
0 1 1 0 0 | 0 1 1
0 1 1 0 1 | 1 0 0
0 1 1 1 0 | 1 0 1
0 1 1 1 1 | 1 1 0
1 0 0 0 0 | 0 0 1
1 0 0 0 1 | 0 1 0
1 0 0 1 0 | 0 1 1
1 0 0 1 1 | 1 0 0
1 0 1 0 0 | 0 1 0
1 0 1 0 1 | 0 1 1
1 0 1 1 0 | 1 0 0
1 0 1 1 1 | 1 0 1
1 1 0 0 0 | 0 1 1
1 1 0 0 1 | 1 0 0
1 1 0 1 0 | 1 0 1
1 1 0 1 1 | 1 1 0
1 1 1 0 0 | 1 0 0
1 1 1 0 1 | 1 0 1
1 1 1 1 0 | 1 1 0
1 1 1 1 1 | 1 1 1
S0
Cout0
-------------------------------
Note: Adding two n-bit numbers can result in n+1 bits.
In other words, the output requires an extra bit to account for a carry.
A0
B0
Cin
B0
B1
S1
S2 (Cout1)
A1
B1