What it Does
This circuit demonstrates the function of an XNOR gate, which outputs HIGH (turns on the LED) when both inputs are either LOW or HIGH. The LED lights up when both push-button switches are pressed or when neither is pressed, but it stays off when only one switch is pressed.

Components Needed
- NPN transistors (BC547) – 2
- Resistor (220Ω) – 1
- Resistors (1kΩ) – 2
- Push-button switches – 2
- LED
- Breadboard
- Jumper wires
- Battery (9V) with clip
Step-by-Step Instructions
- Connect the 9V battery to the breadboard using the battery clip.
- Create a positive (Vcc) and negative (GND) rail on the breadboard.
- Insert the first NPN transistor into the breadboard and label its legs as collector, base, and emitter.
- Insert the second NPN transistor next to the first one.
- Place a 220Ω resistor between the positive rail and the anode (longer leg) of the LED.
- Connect the cathode (shorter leg) of the LED to the emitter of the second transistor.
- Connect the emitter of the first transistor to the emitter of the second transistor.
- Connect the collector of the first transistor to the base of the second transistor.
- Connect the collector of the second transistor to the base of the first transistor.
- Place a 1kΩ resistor between the base of the first transistor and one terminal of the first push-button switch.
- Connect the other terminal of the first push-button switch to the positive rail.
- Place another 1kΩ resistor between the base of the second transistor and one terminal of the second push-button switch.
- Connect the other terminal of the second push-button switch to the positive rail.
- Verify all connections, then test the circuit by pressing both switches, neither switch, or only one to observe the LED behavior.

How it Works
The XNOR gate combines XOR and NOT logic. When both push-button switches are not pressed (inputs LOW) or both are pressed (inputs HIGH), the transistors turn ON or remain OFF in a complementary way, allowing current to flow through the LED, lighting it up. When only one switch is pressed (one input HIGH), the transistors disrupt the current path, turning the LED OFF. The resistors limit the current to protect the components.