Classical Full Adder

Full Adder

⇒ 총 5 bit 연산

Circuit

ChatGPT 2024-11-01 03.04.01.png

Ripple Carry Adder

image.png

Quantum Full Adder

Truth Table

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

Quantum gates

$$ Sum = A \oplus B \oplus C_{in}\\ C_{out} = A B \oplus ((A \oplus B)C_{in})

$$

Code

Conclusion