Instructables

Step 2: How It Works - Part I

The basic adding circuit is just that, basic!  It consists of a XOR gate and an AND gate to give you the basic output with a carry bit.

The XOR gate is short for exclusive or.  In a regular OR gate, 0 and 0 equal 0, 1 and 0 equal 1, 1 and 1 equal 1.  In an exclusive or gate, 0 and 0 equal 0, 1 and 0 equal 1, 1 and 1 equal 0.  This is important because when adding 1 and 1 in binary you get 10, so the ones place has a zero, something that can't be done with a basic OR gate.

OR:
A  B  Y
0  0  0
1  0  1
0  1  1
1  1  1

XOR:
A  B  Y
0  0  0
1  0  1
0  1  1
1  1  0

So now, when you add 1 and 0, you get 1, but hold on...When you add 1 and 1, you get 0?? That can't be right! In order to fix that, we need to be able to have 1 and 1 equal 10. Welcome to the AND gate.  As the name implies, an AND gate equals 1 when A=1 AND B=1.  This it tied in parallel with the XOR gate and is the carryout bit, so that when you add 1+1, you CAN get 10!
 
Remove these adsRemove these ads by Signing Up