Building a Half Adder

 

Building a Half Adder – Combining Logic Gates

A Half Adder is one of the simplest examples of how digital logic gates can be combined to perform arithmetic. It takes two binary inputs and outputs their sum and carry, just like how you’d add two 1-bit numbers on paper.

If you’ve already built your AND, OR, and XOR gate projects, this is where things start getting interesting, we’ll combine them into a working digital circuit.

What You’ll Learn

  • How a half adder performs binary addition

  • How to combine an XOR and an AND gate

  • How to test and visualize binary outputs with LEDs

Understanding the Logic

When you add two binary digits (A and B), the possible outcomes are:


Here’s what’s happening:
  • Sum is A XOR B → only true when one input is HIGH.

  • Carry is A AND B → only true when both inputs are HIGH.

That’s it a Half Adder is literally just an XOR gate and an AND gate working together.

Parts You’ll Need

  • 1 × 74LS86 (XOR gate)

  • 1 × 74LS08 (AND gate)

  • Breadboard + jumper wires

  • 2 × Push buttons or jumper wires (for A and B inputs)

  • 2 × 10 kΩ resistors (pull-downs)

  • 2 × LEDs (Sum and Carry indicators)

  • 2 × 330 Ω resistors (LED current limiters)

  • 5 V power supply (or Arduino 5 V pin)

Circuit Diagram

Circuit Wiring Overview

  1. Connect 5 V (pin 14) and GND (pin 7) on both ICs.

  2. Connect A and B inputs to both gate ICs:

    • +5V to the push buttons then to pin 1 of 74LS86 (XOR) and pin 1of 74LS08 (AND)

    • +5V to the push buttons then to pin 2 of 74LS86 (XOR) and pin 2of 74LS08 (AND)

    • Use pull-down 10 kΩ resistors on inputs between the push button and the logic chips, so they read LOW when buttons aren’t pressed.

  3. The XOR output (pin 3 on 74LS86) drives the SUM LED (red) though a 330Ω resistor and onto ground.

  4. The AND output (pin 3 on 74LS08) drives the CARRY LED (yellow) though a 330Ω resistor and onto ground.

Understanding It Visually

  • No buttons pressed → both inputs LOW → SUM = 0, CARRY = 0 (both LEDs OFF)

  • Press A only → SUM = 1, CARRY = 0 (SUM LED ON)

  • Press B only → SUM = 1, CARRY = 0 (SUM LED ON)

  • Press A and B → SUM = 0, CARRY = 1 (CARRY LED ON)

Next Steps

This is your first combinational logic circuit. From here, you can:

  • Build a Full Adder using two Half Adders + an OR gate.

  • Chain adders together to create a 4-bit binary adder.

  • Use LEDs or a 7-segment display to visualize results.

Comments

Popular posts from this blog

Math Behind Logic Gates

6502 - Part 2 Reset and Clock Circuit

Building a 6502 NOP Test