# Would like some help with Logic Gates, Trying to use two inputs to create three outputs

I'm totally lost and I've got no idea what to search to help find this. Basically I have two inputs [A,B] Where A represents the number 1 and B represents the number 2. I'm trying to make it so when 1 is "on" It turns on a little LED, and when two is "on" it turns a seperate LED on. I've got that, but I want to add an AND gate to make it so when both are on it turns a new LED on and the other two turn off. I've tried using a XOR gate & and gate but it can't differentiate the two signals, [1,2] Hopefully I can finally understand this. I'm currently using Logism to make it easy to see and understand. Thanks.

• Think of this as 3 separate problems, one for each of the LEDs. Write a truth table for each one, giving the output for each combination of inputs. Mar 6, 2016 at 3:16

## 3 Answers

Try this

simulate this circuit – Schematic created using CircuitLab

• mine's prettier :P Mar 6, 2016 at 3:38

A Simpler Way?

Given you haven't specified what rail the LEDs are connected to, it is actually possible to implement the solution showed by both @WhatRoughBeast and @RobhercKV5ROB (both are the same circuit effectively), using just three 2-input NAND gates:

simulate this circuit – Schematic created using CircuitLab

Basically the LEDs are wired up to act as inverters - if the output is high, then the LED is off. This allows all the gates to be transformed into NAND gates.

Fun facts:

This is also the most optimal way to design it using 7400/4000 series ICs (just one!).

It can also become the most optimal at the transistor level - by stripping away unused parts of the NAND gates, it could me made using just 5 NMOS transistors!

You can accomplish this easily with 3 AND gates & 2 inverters. Here's a schematic example:

The 3 AND gates turn on the LEDs. The 2 inverters turn off both the 'single' LEDs if the center 'dual' LED is lit due to 1=2=on

• You beat me by 3 seconds. And mine is clearer. Mar 6, 2016 at 3:39
• @WhatRoughBeast yeah, I'm on my cell...no access to CircuitLab (& I'd have beaten you by 2 minutes if I didn't have to reboot the stinkin' thing to get the img to upload). Mar 6, 2016 at 3:44
• You do not need two inverters. Both of them are doing the same thing so one could be pulled out. Mar 6, 2016 at 4:38