A + B = Sum
$$ A + B + C_{in} = S + 2C_{out}\\ Sum = A \oplus B \oplus C_{in}\\ C_{out} = A B \oplus ((A \oplus B)C_{in}) $$
Where: $\oplus$ XOR (exclusive OR)
⇒ 총 5 bit 연산
A | B | Cin | S | Cout |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 1 | 1 |
$$ Sum = A \oplus B \oplus C_{in}\\ C_{out} = A B \oplus ((A \oplus B)C_{in})
$$