Building a Half Adder
Build a half adder circuit using XOR and AND gates—the fundamental building block of all digital arithmetic.
Overview
A half adder is the simplest arithmetic circuit—it adds two single bits and produces a sum and carry output. The XOR gate produces the sum (1+1=0 with carry, 1+0=1, 0+0=0), while the AND gate produces the carry (only 1+1 generates a carry). This is the foundation of all digital arithmetic, from calculators to computer processors!
Components Needed
- 1x SN74HC86 IC (XOR)
- 1x CD4081 IC (AND)
- 2x LED
- 2x Switch
- severalx Wires
Instructions
Gather Your Components
You'll need the SN74HC86 (XOR) IC, CD4081 (AND) IC, two switches, two LEDs (one for sum, one for carry), wires, breadboard, and 5V power source.
Wire the Half Adder Circuit
Place both ICs on the breadboard. Power them both (pin 14 to 5V, pin 7 to ground). Connect both switch outputs to BOTH chips—the same two inputs go to the XOR gate pins 1,2 and AND gate pins 1,2. Connect XOR output (pin 3) to the Sum LED. Connect AND output (pin 3) to the Carry LED.
Test: 0 + 0 = 00
With both switches OFF (to the right), both inputs are 0. Adding 0+0=0 with no carry. Both LEDs should be OFF—Sum=0, Carry=0.
Test: 1 + 0 = 01
Turn the left switch ON (to the left). Now you're adding 1+0=1. The Sum LED turns ON, Carry stays OFF. The XOR detected different inputs, AND detected not-both-high.
Test: 0 + 1 = 01
Switch positions—left OFF, right ON. You're adding 0+1=1. Same result: Sum LED ON, Carry LED OFF. Order doesn't matter in addition!
Test: 1 + 1 = 10
Turn both switches ON. Adding 1+1=10 in binary (which is 2 in decimal). The Sum LED turns OFF (the "ones" place is 0), but the Carry LED turns ON (we carry a 1 to the next place). This is binary addition in action!
Challenges
- Extend this to a full adder by adding an OR gate for the carry-in (next project)
- Calculate what numbers you can add with multiple half adders chained together
- Build a 2-bit adder using two half adders and an OR gate
- Compare the half adder truth table to binary addition by hand