# using decoder to receive a function with 1 out

Discussion in 'Electronic Basics' started by [email protected], Dec 28, 2005.

1. ### Guest

Hi peaple,

I have a logic function:
F(A,B,C) = A XOR C

How can I implement it using 2-to-4-line Decoder (74LS156) and NAND
gate ?

2. ### PeteSGuest

Without doing your homework for you, I'll give you a couple of
pointers.

1. Write the truth table for A XOR C (If you can't do that, you're
going to fail)

2. The '156 is a dual 2-4 line decoder (The On Semi datasheet states
'DUAL 1-OF-4 DECODER/DEMULTIPLEXER').
Datasheet at: http://www.onsemi.com/pub/Collateral/SN74LS155-D.PDF
Take A and C to the inputs of each decoder and figure out which outputs
become valid for the truth table you constructed above.

3. Use the NAND as an OR gate (which it is - low OR low = high - see
DeMorgan's theorem) to get your final output.

Cheers

PeteS

3. ### Guest

Thanks PeteS,

I've did it in such a manner but was not sure for 100% if it's correct.

Best Regards.

4. ### noviceGuest

even i have tried but to no avail. interesting problem???

5. ### PeteSGuest

This is a pretty simple assignment, and seeing as it's the season of

"The LS155 and LS156 can be used to generate all four minterms of two
variables. These four minterms are useful in some applications
replacing multiple gate functions..."

Generating a result for each minterm means each possible input
combination is detected. (That's what a decoder does, after all).
As each one is detected, it's pretty simple to get the equivalent of an
XOR, but the decoder will have two outputs valid for the XOR function.
(The XOR two-input truth table has two high outputs for the 4 possible
input combinations. Note I am using 'positive logic' to say 'when the
output is a logical 1, the input term is satisfied').

One solution (There are more than one)

Inputs A and C go to the A0 and A1 pins (which way around is irrelevant
in this case)

Enable decoder 'A', disable decoder 'B' (See the datasheet on how to do
it)

Take the #O1 and #O2 outputs to the inputs of a two input NAND. The
output of the NAND will be high when the A0 and A1 inputs are different
(one definition of an XOR). Now figure out why that is so. (#O1 means
'Output 1, which is active when low').

Cheers

PeteS

6. ### Guest

PeteS ,

I very appriciate your help. I found here two solutions.It was realy
easy. The problem was that I started doing my homework at night.

Thanks again.  