1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help in designing a logic circuit

  1. Feb 1, 2015 #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
     
  2. jcsd
  3. Feb 1, 2015 #2

    phinds

    User Avatar
    Gold Member
    2016 Award

    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
     
  4. Feb 1, 2015 #3
  5. Feb 1, 2015 #4

    phinds

    User Avatar
    Gold Member
    2016 Award

  6. Feb 1, 2015 #5

    gneill

    User Avatar

    Staff: Mentor

    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.
     
  7. Feb 1, 2015 #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 any one switch is on, LED2 turns on when two switches are on and LED turns on when all three switches are on.??
     
  8. Feb 1, 2015 #7

    gneill

    User Avatar

    Staff: Mentor

    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.
    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.
     
  9. Feb 1, 2015 #8
    Thank you so much for the help.
    I will follow your advice and work on the LED2 in the middle.
    Much appreciated.
     
  10. Feb 1, 2015 #9

    NascentOxygen

    User Avatar

    Staff: Mentor

    Add the 3 resistors to Vcc as gneill suggested, then test your circuit again.
     
  11. Feb 3, 2015 #10

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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: Feb 3, 2015
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Need help in designing a logic circuit
  1. Logic circuit design (Replies: 8)

Loading...