XOR Gate Using SN74HC86 IC

Build an XOR (exclusive OR) gate using the SN74HC86 IC—outputs HIGH only when inputs are different.

Overview

The XOR (exclusive OR) gate is unique—it outputs HIGH only when its inputs are DIFFERENT. Same inputs (both 0 or both 1) produce LOW. This "difference detector" is essential for arithmetic circuits like adders, as it performs binary addition without the carry.

Components Needed

  • 2x Switch
  • 1x LED
  • 1x SN74HC86 IC
  • 1x 10kΩ resistor
  • severalx Wires

Instructions

  1. Gather Your Components

    Collect the SN74HC86 IC, two switches, one LED, a 10kΩ resistor, wires, breadboard, and 5V power source.

  2. Identify the SN74HC86 IC

    The SN74HC86 is a 14-pin IC with four 2-input XOR gates. Pins 1 and 2 are inputs to the first gate, pin 3 is its output. Pin 7 is ground, pin 14 is VCC.

  3. Wire the Circuit

    Place the IC on the breadboard. Connect pin 14 to 5V and pin 7 to ground. Connect the two switches to pins 1 and 2. Connect pin 3 to the LED. Use pull-down resistors on the inputs.

  4. Test: Both OFF → LED OFF

    With both switches OFF (to the right), both inputs are LOW—they're the SAME. XOR outputs LOW when inputs match, so the LED is OFF.

  5. Test: Left ON, Right OFF → LED ON

    Turn the left switch ON (to the left). The inputs are now DIFFERENT (one HIGH, one LOW). XOR outputs HIGH, and the LED turns ON!

  6. Test: Left OFF, Right ON → LED ON

    Switch positions—left OFF, right ON. The inputs are still different, just opposite. XOR still outputs HIGH, and the LED stays ON.

  7. Test: Both ON → LED OFF

    Turn both switches ON (to the left). Both inputs are HIGH—they're the SAME again. XOR outputs LOW, and the LED turns OFF. Notice how XOR only lights up when inputs differ!

Challenges

  • Use XOR as a controlled inverter—tie one input HIGH and toggle the other
  • Build a simple parity checker using multiple XOR gates
  • Combine XOR with AND to build a half adder (next project!)
  • Design a circuit to detect when two binary numbers differ