I've created a logic problem for myself, but I'm a total noob!

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

sircletus

Well-known member
Joined
Nov 19, 2008
Messages
165
Okay.  Been tinkering with analog audio electronics off and on for several years, but I have only a very rudimentary understanding of digital logic circuits (I can do truth tables for all the basic gates, but that's about it).  So I've created a bit of a problem for myself that I'd like to try and solve with logic ICs:

- I have 6 gates
- I have 3 push-button switches
- Different combinations of gates need to go high based on combinations of the three push-buttons

I've attached a pic of what my logic table would look like.  How do I go about making this sucker a circuit?  I just don't know what the next step would be.

I have done something like this in that past with many, many more gates (20-ish?), but I cheated: I crammed an Arduino in the box told it which of its gazillion outputs to send 5V to based on input combos.
 

Attachments

  • Table.JPG
    Table.JPG
    1.7 MB · Views: 37
Okay, so I've already constructed a basic circuit in LogiSim using only AND, OR and NOT gates.  Now to actually make it using actual logic ICs...

Looks like...

7x    NOT gates
2x    3-input AND gates
4x    2-input AND
3x    2-input OR

 

Attachments

  • Screen Shot 2019-10-18 at 3.33.47 PM.png
    Screen Shot 2019-10-18 at 3.33.47 PM.png
    86.5 KB · Views: 14
A lot of it you can do by inspection. For example the first gate column is all zeros in the last places which is the inverse of  button C. However, the first four in that column are only 1 when button A is also 1. So the function to create the first column is:

NOT C  AND  A

You can work out the others in a similar way.

Cheers

Ian
 
JohnRoberts said:
or use a micro... ;D

JR

Yeah, aside from truly copping out and using an Arduino or something with an IDE, I wouldn't know where to begin.  I'm also trying to do this as cheaply as possible.  The application: gates will turn on transistors to close relays.

As for small, cheap micro-controllers, any recommendations on how/where to begin?  I find it all very fascinating, but I'm so swamped 9 months of the year that I feel like I have very little time to truly immerse myself in anything new.  It gets frustrating.
 
As for small, cheap micro-controllers, any recommendations on how/where to begin?

I don't see MC's as cheating. :)  Someone a few months back recommended I use an arduino  micro with shift registers or multiplexing to get the required pin count down. They were using some buffer IC's over I2C as well.
 
You can do a LOT with an Arduino and a shift register.

Now that Arduino can be coded with Blockly getting started is even easier... no coding required... just move some blocks around and type in some values. I even taught it to incoming 6th-graders this last summer school session.
 
sircletus said:
How do I go about making this sucker a circuit?  I just don't know what the next step would be.

Simple BCD or bin 3bit to decimal converter (TTL7442, CD4051, CD4028 ....) and 19pcs of 1N4148 diodes.
1.5 Euro in Mouser altogether.
5 minutes on a breadboard. 
 
Thanks for the responses, everyone.  I have plenty of programming experience, including with Arduino, so that's no big deal, and I feel oddly relieved that others don't see it as cheating.  ;D  I'll definitely check out Blockly for expediting things.  Hopefully that will generate cleaner code that my sloppy stuff.  I ended up solving my problem with a total of four 74-series ICs.  Cheap and easy!  Just got to jog the ol' memory sometimes.  But I seem to be getting a lot of "full buffer" errors these days.  :D
 
Atmel ATTiny84 would been perfect microcontroller for the task, programmed using AVR C.

https://www.microchip.com/wwwproducts/en/ATtiny84

I've used the smaller ATTiny84 for simpler tasks not needing so many I/O's.



 
All you need is a Karnaugh map solver/simplifier.

Based on your equations, I get

1 = C'A
2 = C'B'A' + C'BA
3 = C'B' + B'A'
4 = C'B'
5 = CA'
6 = CB'
 

Latest posts

Back
Top