Designing a logic circuit. Please help..

Thread Starter

Bhavzp16

Joined Feb 1, 2015
4
Design a circuit that will light the same number of LEDs as there are active switches. You will utilize three switches as input. The LEDs should be lit as a bar-magnitude display. The output pattern should look as follows: Active Input switch count LED bar-magnitude display (vertical) no switches active 0 - 0 - 0 any 1 switch active 1 - 0 - 0 any 2 switches active 1 - 1 - 0 all 3 switches active 1 - 1 – 1

upload_2015-2-1_17-51-59.png

I am not really sure about the circuit.
 

Attachments

WBahn

Joined Mar 31, 2012
26,398
Your ...-59.png image doesn't display. The ...-4.png is just an OR gate.

You need to show YOUR best attempt to answer YOUR homework.

How about making a truth table of what you want? You have three switches and three LEDs. So you have eight possible input conditions. Which LEDs should be ON and OFF for each combination?
 

Thread Starter

Bhavzp16

Joined Feb 1, 2015
4
Your ...-59.png image doesn't display. The ...-4.png is just an OR gate.

You need to show YOUR best attempt to answer YOUR homework.

How about making a truth table of what you want? You have three switches and three LEDs. So you have eight possible input conditions. Which LEDs should be ON and OFF for each combination?
Hey WBahn,

Thanks for replying.
Any 1 switch is active one LED should turn on thats what I was thinking that its going to be an OR gate. Because the truth table gives when one 1 one LED is on and when two switches are active two LEDs are on so when all the three switches are active all three LED should come on. Truth table gives an OR gate combinations but doesnt work exactly like the question when you desing it.
Any suggestion, would be really appreciated.

Bhavin
 

Thread Starter

Bhavzp16

Joined Feb 1, 2015
4
Yes I know how to make that and I knw when one switch is on LED1 will come on, LED will only come on when two switches are on and LED will come on only when all the three switches are on.
Bu still I am unsure about the circuit.
 

ScottWang

Joined Aug 23, 2012
7,080
I simplify your circuit, that was the same with yours, when you completed the truth table then go back to check the circuit.

Designing a logic circuit_Bhavzp16-01.gif
 

WBahn

Joined Mar 31, 2012
26,398
Hey WBahn,

Thanks for replying.
Any 1 switch is active one LED should turn on thats what I was thinking that its going to be an OR gate. Because the truth table gives when one 1 one LED is on and when two switches are active two LEDs are on so when all the three switches are active all three LED should come on. Truth table gives an OR gate combinations but doesnt work exactly like the question when you desing it.
Any suggestion, would be really appreciated.

Bhavin
I already gave you a suggestion. Put together a truth table that has three inputs (the three switches) and that has three outputs (for the three LEDs). For each row, indicate which LEDs should be ON or OFF. I'm not going to do it for you.

You want to learn to take a systematic approach to logic design. The method you are trying to use is to hope for "a happening" -- namely you throw together something based on some thoughts and guess and hope that it "happens" to do what you want.
 

WBahn

Joined Mar 31, 2012
26,398
Yes I know how to make that and I knw when one switch is on LED1 will come on, LED will only come on when two switches are on and LED will come on only when all the three switches are on.
Bu still I am unsure about the circuit.
If you know how to make that, then make that.

Don't just announce that you know how to do it and then ask for people to show you what to do. Demonstrate that you can get that much correctly and then, after verifying that you actually have gotten that far correctly, we have a basis from which to go further.
 

ScottWang

Joined Aug 23, 2012
7,080
Ah, okay. I thought that was your circuit (the original post wouldn't display his embedded image at first).
I saw you said that you can't see the image, but when I get into this thread, everything seems normal, and I didn't see the TS reedit, and I also mentioned that my circuit is the same with TS, because I saw the wiring of circuit were mixed too much and it's hard to see, so I just rewiring the wires.
 

MrChips

Joined Oct 2, 2009
24,610
Note that switch S1 is wired incorrectly. If the row of switches are SPST then closing a switch will create a short between Vcc and GND.
SPST switches used as logic inputs are commonly wired by shorting digital inputs to ground. Inputs would normally be logic-high with 1k-3.3kΩ pullup resistors to Vcc when the switch is in the open position.
 

WBahn

Joined Mar 31, 2012
26,398
I saw you said that you can't see the image, but when I get into this thread, everything seems normal, and I didn't see the TS reedit, and I also mentioned that my circuit is the same with TS, because I saw the wiring of circuit were mixed too much and it's hard to see, so I just rewiring the wires.
I was confused by what you meant since I didn't have sufficient context (and had forgotten that there was an image in the first post that I hadn't been able to see). All it well.
 
Top