Need help in designing a logic circuit

In summary: LED 2 when all three are on. Just something to check.In summary, a circuit was designed to light the same number of LEDs as there are active switches, using three switches as input. The LEDs are lit in a bar-magnitude display, with the following output pattern: - No switches active: 0 - 0 - 0 - 1 switch active: 1 - 0 - 0 - 2 switches active: 1 - 1 - 0 - 3 switches active: 1 - 1 - 1 The original design did not work and the conversation suggested using a K-map or a truth table to illustrate the logic. The final design includes pull-up resistors and logic gates
  • #1
Bhavin
4
1
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

http://forum.allaboutcircuits.com/attachments/upload_2015-2-1_17-51-59-png.79759/
I have tried the above design but didnt work and now I am back to square one.
There are three switches and three LEDs so total 8 combinations and LED is on when any switch is active...
Please help.
Thanks
 
Physics news on Phys.org
  • #2
Bhavin said:
Design a circuit that will light the same number of LEDs as there are active switches.
I suggest that you draw a K-map or a truth table to illustrate the logic of the desired outcome. If you can get that right, turning it into a circuit will be trivial
 
  • #3
This is the circuit I have designed but its not working i don't know what's wrong with it.
http://forum.allaboutcircuits.com/attachments/upload_2015-2-1_17-51-59-png.79759/
Any suggestion?
 
  • Like
Likes bobbin
  • #4
Bhavin said:
This is the circuit I have designed but its not working i don't know what's wrong with it.
http://forum.allaboutcircuits.com/attachments/upload_2015-2-1_17-51-59-png.79759/
Any suggestion?
See my previous post. Why did you post your circuit twice? Your second posting of it was unnecessary.
 
  • #5
Re your circuit, I don't think you want to be shorting your Vcc to ground via the switches. Use some pull-down or pull-up resistors.

What types of gates are you allowed? I see ANDs and ORs (even three-input ORs), but I don't see any NOT gates.
 
  • #6
Yeah I wanted to use pull-up resistors and connect my switches to ground and any types of gates are allowed.
I am not sure how can design because LED one is on when anyone switch is on, LED2 turns on when two switches are on and LED turns on when all three switches are on.??
 
  • #7
Bhavin said:
Yeah I wanted to use pull-up resistors and connect my switches to ground and any types of gates are allowed.
Start with a pure Logic circuit, and table the switch implementation for now. Draw three vertical lines representing inputs A, B, and C. They take on the logic values according to the switch values. You can add in the electronics (switches, resistors, power supply) to set the logic states on those lines later.
I am not sure how can design because LED one is on when anyone switch is on, LED2 turns on when two switches are on and LED turns on when all three switches are on.??
Okay, this is why you should take @phinds advice and start with a Karnaugh map approach. The state of each LED can be represented as a function of three inputs, so three separate 3-input Karnaugh maps can describe the three functions required. You can probably design circuits for LEDs 1 and 3 without use of the maps, since "at least one" and "all three" are pretty easy to deduce and implement with a pair of gates each. So concentrate on the "any two are on" issue for the middle LED.
 
  • #8
Thank you so much for the help.
I will follow your advice and work on the LED2 in the middle.
Much appreciated.
 
  • #9
Bhavin said:
I have tried the above design but didnt work and now I am back to square one.
Add the 3 resistors to Vcc as gneill suggested, then test your circuit again.
 
  • #10
Bhavin said:
Yeah I wanted to use pull-up resistors and connect my switches to ground and any types of gates are allowed.
I am not sure how can design because LED one is on when anyone switch is on, LED2 turns on when two switches are on and LED turns on when all three switches are on.??

Have you labeled your LED's correctly? Or mis-connected them? Looks to me like LED 3 turns on when any two switches are on.
 
Last edited:

FAQ: Need help in designing a logic circuit

What is a logic circuit?

A logic circuit is a type of electronic circuit that performs logical operations based on input signals. It uses logic gates to process binary inputs and produce binary outputs.

How do I design a logic circuit?

To design a logic circuit, you first need to determine the logical operation you want it to perform. Then, you can use a truth table to map out the inputs and outputs and choose the appropriate logic gates to achieve the desired result. Finally, you can draw a schematic diagram of the circuit and use circuit design software to simulate and test it.

What are some common types of logic gates?

Some common types of logic gates include AND gates, OR gates, NOT gates, NAND gates, and NOR gates. These gates can be combined in various ways to perform more complex logical operations.

Can I use any components to build a logic circuit?

While certain components are specifically designed for use in logic circuits, such as logic gates and flip-flops, you can also use basic electronic components like resistors, capacitors, and transistors to build a logic circuit.

How can I troubleshoot a logic circuit that is not working?

If your logic circuit is not working as intended, you can use a multimeter to test the inputs and outputs of each logic gate and identify any faulty components. You can also use circuit simulation software to troubleshoot and identify any errors in your design.

Similar threads

Replies
14
Views
2K
Replies
5
Views
4K
Replies
19
Views
2K
Replies
2
Views
2K
Replies
2
Views
8K
Replies
25
Views
4K
Back
Top