One chip logic operation challenge - Page 1
Forum section: electronics / projects

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 08:56:08 am
content: Here's a small problem that I have not found a good answer to:I need a very simple tri-state logic operation preformed. It's easy to do with two chips. But I have almost no real-estate available on the PCB so I would like to solve it with a single SOIC chip with as few pins as possible. After much searching I am still empty handed.Truth TableA B Output----------------L L High-ZL H High-ZH L LowH H High-Z(VDD = 3.3V)

author: Rerouter
author_rank: Super Contributor
timestamp: February 01, 2014, 09:14:37 am
content: To start you off the type of chip would be refereed to as open collector output,you would use a NAND chip and invert one of the signals, using a second gate (will need a pullup resistor due to open collector)

author: oPossum
author_rank: Super Contributor
timestamp: February 01, 2014, 09:16:16 am
content: It can be done with half of a 74HC03

author: daveatol
author_rank: Regular Contributor
timestamp: February 01, 2014, 09:49:11 am
content: You can do it with a single N channel MOSFET and schottky diode: A - gate, B - drain, output - drain through schottky diode.Note: The B input has to be able to provide whatever output current is required, of course.

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 09:53:57 am
content: Quote from: oPossum on February 01, 2014, 09:16:16 amNo, this does not provide High Z output.

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 09:57:01 am
content: Quote from: Rerouter on February 01, 2014, 09:14:37 amI'm not aware of a dual-NAND gate chip with open collector output....Quad NAND = 14 pins, no space for that unless its LCC chip, which is too hard to solder.

author: Rerouter
author_rank: Super Contributor
timestamp: February 01, 2014, 10:03:10 am
content: then take on opposums idea with a sot-23 pnp on the output to make it open collector...or similaqr to daveatols use a npn, A goes to the base (with a resistor), B goes to emitter, collector is the output, if your output cannot sink that current, use a second sot23 package pnp, base goes to B with a resistor, collector goes to ground and emitter goes to the npn's emitter2 0805 resistors and 2 sot23's plenty easy to solder, and if rotated right will be only a smidgen bigger than a soic

author: daveatol
author_rank: Regular Contributor
timestamp: February 01, 2014, 10:13:34 am
content: Quote from: Rerouter on February 01, 2014, 10:03:10 amI originally said just use a single MOSFET, but it won't work unless there's a diode in series with the drain (due to the leakage through the MOSFET's bulk/body diode). Just use a schottky for low voltage drop, if that's important.Both of your BJT configurations will suffer from issues when both A and B are high - there will be leakage current through B-C of the NPN; this will be amplified by the reverse current gain of the transistor in the case of the single NPN configuration. Putting a series diode on the output will get around this problem.

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 10:43:59 am
content: Quote from: daveatol on February 01, 2014, 10:13:34 amHmm... Interesting solution. But... looking at the datasheet for the input that this thing is driving, it says max allowed voltage to recognize a low is 0.4V. This is about as low as a schottky will go, so unfortunately it will be too marginal for comfort.

author: daveatol
author_rank: Regular Contributor
timestamp: February 01, 2014, 10:49:34 am
content: QuoteHow much current is pulled in the low state? If it's less than 10mA, then the output will be less than your 0.4V limit. See first page ofhttp://www.fairchildsemi.com/ds/BA/BAT54.pdf(forward voltage at IF=10mA [or less])

author: nctnico
author_rank: Super Contributor
timestamp: February 01, 2014, 10:51:25 am
content: Quote from: chebeba on February 01, 2014, 08:56:08 amUse tiny logic (single or dual gate) in an SC70 package. You can fit 4 of those in the space of one SOIC chip. No need to mess with mosfets, diodes and so on.

author: kolbep
author_rank: Frequent Contributor
timestamp: February 01, 2014, 11:16:53 am
content: Lets go overboard, use a 8 pin pic uC

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 11:20:18 am
content: Quote from: kolbep on February 01, 2014, 11:16:53 amWith tri-state outputs? They exist?

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2014, 11:32:44 am
content: QuoteYes.

author: Rick60
author_rank: Contributor
timestamp: February 01, 2014, 11:33:09 am
content: To simplify Rerouter idea replace the PNP wih a NPN transistor with its emitter to ground its collector to the base of the output transiistor .Also all pics hace a tris register , so I quess you could use a pic10F200 6 pin sot23 , but then you need code and a programmer

author: Lunasix
author_rank: Regular Contributor
timestamp: February 01, 2014, 11:40:32 am
content: I propose 74LVC1G97 (sot363, use B and C, A set to 0) with a small transistor like PDTC143 or PDTC114 (sot23).

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 11:42:34 am
content: Quote from: Rick60 on February 01, 2014, 11:33:09 amOK, I should have remembered this, worked a lot with PIC's but it was a few years ago.But I took this more as a joke, providing the programming connections will take up an enormous space and extra mfg steps (programming).

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 01, 2014, 12:20:25 pm
content: Quote from: chebeba on February 01, 2014, 11:42:34 amMicrochipDirect will supply ready-programmed, and marked chips for a few cents extra

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 01, 2014, 12:26:47 pm
content: How about this - dual N-channel MOSFET in SOT-23-6 package

author: tjaeger
author_rank: Regular Contributor
timestamp: February 01, 2014, 12:28:21 pm
content: Quote from: chebeba on February 01, 2014, 08:56:08 amHow about 74LVC1G53? With A = ~E, B = S, Y0 = GND and Y1 floating.

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 01:37:58 pm
content: Quote from: tjaeger on February 01, 2014, 12:28:21 pmOK, lots of good input from everyone here, but for me this is the winner.Single 8 pin component, no worries.

author: Rerouter
author_rank: Super Contributor
timestamp: February 01, 2014, 01:41:51 pm
content: Actually yes that would be a good use, (that or an optocoupler / analog switch to ground) as its a diode the truth table can only be filled when a positive and negative are provided one way,e.g.http://au.element14.com/vishay-semiconductor/vo1400aeftr/ssr-mosfet-60v-100ma/dp/1783846only has 1uA of leakage, comes down to if that will be too great for yo.

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2014, 01:51:18 pm
content: Would a lowly mosfet / bjt work?One goes to S, one to G, the output on D.

author: fcb
author_rank: Super Contributor
timestamp: February 01, 2014, 02:23:11 pm
content: Use a 4016/4066, although you'll need one resistor.Create an inverter with 'A' - feed the output of this switch input on 'B'.Connect one side of switch 'B' to ground.Link the two switch elements 'B' and 'C' in series.Your output is now one side of 'C'.Feed your logic into the controls 'A' and 'B'

author: fcb
author_rank: Super Contributor
timestamp: February 01, 2014, 02:28:25 pm
content: You could also use a multiplexor like the 4052.Feed your logic into pins 9&10.Connect pin2 to ground.Take your output from pin3.

author: chebeba
author_rank: Contributor
timestamp: February 01, 2014, 03:48:33 pm
content: Quote from: Rerouter on February 01, 2014, 01:41:51 pmHaha! Very creative ideaCertainly small in terms of real estate. I will keep that on in the back of my head, although for this application the LED consumes too much power.

author: oPossum
author_rank: Super Contributor
timestamp: February 01, 2014, 09:57:17 pm
content: Quote from: chebeba on February 01, 2014, 09:53:57 amYes it does - the 74HC03 is open collector output.

author: jwm
author_rank: Regular Contributor
timestamp: February 04, 2014, 02:33:55 am
content: I keep on meaning to write a 'logic optimizer' that will take a truth table and optimize to the lowest chip count using standard 74/4k components using all of don lancasters tricks from his cookbook. It would be a fun project, I could see it being used as a standard homework assignment in a programming course on algorithm design rather than the standard 'program to play checkers' or whatever is used to teach branch and bound techniques.

author: dannyf
author_rank: Super Contributor
timestamp: February 04, 2014, 11:56:28 am
content: QuoteThose fpga/cpld compilers do precisely that, and many more.

author: jwm
author_rank: Regular Contributor
timestamp: February 04, 2014, 12:18:19 pm
content: Quote from: dannyf on February 04, 2014, 11:56:28 amNo, they optimize to minimum gate count, or at least to the specific internal architecture of a given CPLD/FPGA such as minimum usage of LUTs in FPGA or summation terms in a CPLD perhaps.The espresso algorithm works pretty well for pure gate count optimization on this scale, I used a variant of it for programming GALs.I want to optimize for minimum _chip_ count of a limited set of readily available chips, or find a way to implement it with a specific subset of chips. As in, answering the type of question that started this thread. Also, in addition to the one, zero, and don't care it also must understand things such as open collector, tri-state, and so forth and use resources like the 4066 switch that isn't quite a logic gate but quite handy for simplifying logic circuits.

author: dannyf
author_rank: Super Contributor
timestamp: February 04, 2014, 12:23:27 pm
content: QuoteEasy: limit your "readily available chips" to NAND gates and use the said fpga/cpld software.That's actually what I do - HC132 all the way,

author: jwm
author_rank: Regular Contributor
timestamp: February 04, 2014, 02:02:11 pm
content: Quote from: dannyf on February 04, 2014, 12:23:27 pmDue to a misorder a while ago I ended up with 250 extra 74LVX14 chips. Turns out you can find a whole lot of things to do with schmitt inverters... My favorite recent trick is to use two in a loop with 10k resistors and diodes as a S/R latch. That's three S/R latches with inverting an normal inputs and outputs per 74xx14! I even made up little breakout boards (picture attached) for them to motivate me to breadboard with them more. I call them schmites (schmitt + mite).When I am feeling nostalgic for the apollo guidance computer I limit myself to 3 input nor gates.

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 04, 2014, 02:21:24 pm
content: Quote from: chebeba on February 01, 2014, 11:20:18 amtry smaller 6pins sot like pic10f200, you have extra 1 pin to mess around. 3 drawbacks.. 1) respond time can be a problem in some app 2) it sucks more power 3) you need to program it.edit: duh this is a 3 pages thread i tot i thaw a putty tet.

author: dannyf
author_rank: Super Contributor
timestamp: February 05, 2014, 01:38:27 am
content: QuoteAs a basic building block, a NOT gate is not as useful as a NAND or XOR gate.

author: jwm
author_rank: Regular Contributor
timestamp: February 05, 2014, 02:05:54 am
content: Quote from: dannyf on February 05, 2014, 01:38:27 amSince it is schmitt, all you need are some diodes to turn them into NOR,OR,AND or NAND gates. No easy way to do XOR I think..http://www.musicfromouterspace.com/analogsynth_new/ELECTRONICS/mickeymouselogic.html

author: zapta
author_rank: Super Contributor
timestamp: February 05, 2014, 07:09:43 am
content: You can try an analog/switch/mux with at least two digital input. The correct combination will connect the output to ground, floating otherwise.Here is an arbitrary example, there are many more.http://www.nxp.com/documents/data_sheet/NX3L4357.pdfHere is another one, with easier to solder packagehttp://www.toshiba.com/taec/components2/Datasheet_Sync//165/7442.pdf