Basic logic problem

Jul 10, 2004 13 Replies

I want a truth table as follows, where A and B are inputs, X and Y are Outputs:



ABXY



0001
0110
1011
1111

I would like to use one chip to decode, such as a 74x02 quad two-input nor gate. I've found two solutions. One is five gates, as shown at

formatting link
, which is one gate too many. The other solution is to use a 74x138. I consider the 74x138 to be a cheat!



In going through this, I'm starting to realize how rusty I'm getting at doing this kind of stuff.



I imagine there's an easy to see, simple solution to this problem. Please enlighten me, I think my brain needs a kick.



Thanks,



Mike


There used to be an CD4XXX chip that had an odd mix of gates inside. I can't recall the number, have no idea if ot's still made, nor if the mix of gates was right for this. I suppose you have no leftover gates or inverters anywhere? Half a 7432 and a single inverter or transistor would get it done.

Why? It is a decode function, after all...

Bill Posted with XanaNews Version 1.16.3.1

ABX

000 011 101 111

That's X = (A OR B)

ABY

001 010 101 111

That's Y = (A OR NOT B)

X = A OR B = NOT ( NOT A AND NOT B ) Y = A OR NOT B = NOT ( NOT A AND B )

Which is 4 NAND.

Sorry, I meant two inverters...

Bill Posted with XanaNews Version 1.16.3.1

nor

Please

OK, I more-or-less came to all of the above on my own, except that I used NOR gates. (Boolean/logic is another area in which a custom font would come in handy because I could throw in some negated letters, but that's another thread.)

I haven't used Boolean it since George Boole & I used to drink poisonous ale and make logic gates out of cat hairs, so please bare with me....

OK, I get that with three nand gates:

formatting link
.

I get two gates for that because you have to invert one of the inputs.

I get 5 gates again, except that you use NAND gates and I use NOR gates.

Mike

I think I can get it done with a single 7402 or 7404 and one transistor as an inverter. Since the 74138 works & is only one chip, I guess I'll go with that.

What concerns me, I think, is my having to think this through for hours and still not remember the definitive way, e.g. using Boolean algebra, to solve this problem. Maybe a five gate solution is the only answer, but how do I know that for sure?

With Boolean algebra, and an equation for each output term. For things as simple as that one, it can be frustrating, when we're so accustomed to high density components, but on the other hand, there's the cost of the time it takes to be more clever about it.

Of course, you could use diodes and resistors, too ;)

Bill Posted with XanaNews Version 1.16.3.1

The

cheat!

at

come

ale

You are missing the obvious. Both equations have a term in common which is NOT A. So Y output can be realized using the NOT A term from X, and one more gate, for a total of 4. Simply adding up the number of gates for each equation will not yield the lowest number possible.

Hope this helps,

Mike Anton

X = A OR B ==> NOT X = A NOR B Use one NOR with A, B as inputs Use another NOR to invert NOT X Y = A OR (NOT X) ==> NOT Y = A NOR (NOT X) Use one NOR with A, (NOT X) as inputs Use another NOR to invert NOT Y

4 NOR gates, right? (Assuming 3 gate delays is okay)

Tom Taylor

X = A OR B ==> NOT X = A NOR B Use one NOR with A, B as inputs Use another NOR to invert NOT X Y = A OR (NOT X) ==> NOT Y = A NOR (NOT X) Use one NOR with A, (NOT X) as inputs Use another NOR to invert NOT Y

4 NOR gates, right? (Assuming 3 gate delays is okay)

Tom Taylor

Wow, I am rustier than I thought! I just worked it through and realized (and proved) that my first answer was correct.

X = (A OR B) Y = (A or (NOT B))

Therefore, one inversion and two sections of a 74C32. So in the absence of an unused inverter, I'd grap a transistor, a couple of resistors, and the 'C32.

Bill Posted with XanaNews Version 1.16.3.1

You could always use one inverter and four diodes!

Feed A through two diodes to X and Y

Feed B through one diode to X

Feed B through one inverter and a diode to Y

(with pull downs on X and Y of course)

Uses only 1/4 of a chip!

Alan

++++++++++++++++++++++++++++++++++++++++++ Jenal Communications Manufacturers and Suppliers of HF Selcall P O Box 1108, Morley, WA, 6943 Tel: +61 8 9370 5533 Fax +61 8 9467 6146 Web Site:
formatting link
e-mail:
formatting link
++++++++++++++++++++++++++++++++++++++++++

Or a single inverter in a SOT23 package like the Fairchild NC7S14 (about 7 cents US).

Cheers, Alf

Two simple solutions:

7400: Two gates for outputs x = !(!A*!B) y = !(!A*B)

Two other gates used as inverters for !A and !B

1/2 74x139 - use out 0 for X and out 1 Y

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required