half adder

Previously, we saw how addition consists of two parts:

  • Adding digits together
  • Handling the carry

We’re going to forget about the carry for now, and just build a device that can add digits.

adding binary digits

We already know we can add two binary digits together, just like with base ten:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 0 = 1
  • 1 + 1 = 0 (carry 1)

If we ignore the carry, this looks like the truth table . That’s an XOR gate! In other words, an XOR gate performs a physical representation of adding binary digits together.

00/0000/00
loading…

xor gate

In this demo, the XOR gate is literally adding together the digits of these two streams (ignoring the carry). We can say our XOR gate is functioning as a half adder.

definition

A half adder is a device that adds together digits, but doesn’t handle the carry.

Next we’ll look at handling the carry so we can turn this into a full adder.

challenge

Adding the digits together looks like the XOR truth table 0110. What does the truth table look like for the carry?

continue