How a half adder works
Have you built a half adder (or are you looking into it) and you want to know how it works? If the answer is yes, then take a look at this.
If you know what a half adder has in it, you can skip this.
A half adder has 1 AND gate for the 2's place, and 1 XOR (Exclusive-OR) gate for the 1's place.
This is the logic:
If you know what a half adder has in it, you can skip this.
A half adder has 1 AND gate for the 2's place, and 1 XOR (Exclusive-OR) gate for the 1's place.
This is the logic:
The XOR gate (1's place)'s output is 1 if the inputs of the XOR gate are different. If the inputs are the same, the XOR gate's output is 0.
The AND gate (2's place)'s output is 1 if the inputs are both 1; otherwise the output of the AND gate is 0.
So, if the inputs of the half adder are both 0, 0+0=00 and no gates return 1.
If the inputs of the half adder are both 1, 1+1=10 so the 1's place (XOR) returns 0, and the 2's place (AND) is 1. So the outputs are (2's place) 1 and (1's place) 0.
If the inputs are different, 1+0=01 or 0+1=01, then the 1's place (XOR) is 1, and the 2's place (AND) is 0, so the outputs are (2's place) 0 and (1's place) 1.
The AND gate (2's place)'s output is 1 if the inputs are both 1; otherwise the output of the AND gate is 0.
So, if the inputs of the half adder are both 0, 0+0=00 and no gates return 1.
If the inputs of the half adder are both 1, 1+1=10 so the 1's place (XOR) returns 0, and the 2's place (AND) is 1. So the outputs are (2's place) 1 and (1's place) 0.
If the inputs are different, 1+0=01 or 0+1=01, then the 1's place (XOR) is 1, and the 2's place (AND) is 0, so the outputs are (2's place) 0 and (1's place) 1.
I didn't have an XOR gate or an AND gate, so I made them with NAND gates (which I did have.) If you want to know how I did it, click here.