How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
Exclusive OR gate: XOR Gate A B Output A B
Simple Adder Circuit: AND Gate 0 0 Carry over = 0 XOR Gate 0 0 Output = 0 AND Gate 1 0 Carry over = 0 XOR Gate 1 0 Output = 1 + +
Simple Adder Circuit: AND Gate 0 1 Carry over = 0 XOR Gate 0 1 Output = 1 AND Gate 1 1 Carry over = 1 XOR Gate 1 1 Output = 0 + +
Full Adder circuit 0 + 0, carry = 0 AND Gate 0 0 Carry over = 0 XOR Gate Carry over input = 0 0 Output = 0 OR Gate AND Gate 0 XOR Gate
Full Adder circuit 0+1, carry = 0: AND Gate 0 1 Carry over = 0 XOR Gate Carry over input = 0 0 Output = 1 OR Gate AND Gate 1 XOR Gate
Full Adder circuit 1+0, carry = 1: AND Gate 1 1 Carry over = 1 XOR Gate Carry over input = 1 0 Output = 0 OR Gate AND Gate 1 XOR Gate
Multi-Bit Adder: X. Y. Z. XYZXYZ XYZXYZ XYZXYZ C. C. C.C.