Electronic – Why is a half adder implemented with XOR gates instead of OR gates

adderlogic-gates

Half adder circuits are implemented with XOR gates for the summing. Why can't the adding function be implemented with OR gates? What is the difference between using XOR gates and OR gates?

Best Answer

0 + 0 = 0 0
0 + 1 = 0 1
1 + 0 = 0 1
1 + 1 = 1 0

The ones place of a single-bit addition is equivalent to the exclusive OR operation, not the OR operation. Hence XOR is used instead. Note that this is not the only way to build a half adder, you can do it without using an XOR gate, but it requires more gates.

For example, here is a half adder built with only AND, OR, and NOT gates:

Half adder

You can see here that an OR gate is used to form the ones place output, but an AND gate is also necessary to turn off that output when the carry output is set.

One thing to note is that these adders are usually implemented not with several separate gates, but as one optimized unit, like this:

CMOS full adder

The construction with logic gates is just a functionally equivalent version of the actual implementation.