4 to 10 Decoder / 10 to 4 Encoder ---- Problems

I am wanting to take a signal and put it into a 4 to 10 decoder. The outputs of the decoder are going to be connected to a 10conductor cable which will connect to the inputs of a 10 to 4 encoder.

I am then wanting to check the output of that encoder with the inputs that I put into the decoder. If they are the same then the test has been passed and if they are not equal then the test has failed.

This is going to be a tester for a 10 conductor cable. I dont want to use 20 I/O's on my chip so I think using decoders/encoders is my best bet.

Problem I am having is finding the encoders and decoders that match up. The ones i ordered were:

Encoder: CD40147B Decoder: CD4028B

If you look at the truth tables of these two they seem like they would work exactly how I wanted them to. After the circuit failed I looked more closely at the truth tables and then realized that the CD40147B's truth table was negative logic. So now I am in a pickle.

Can someone please help me out in this matter? I am either looking for a decoder to match my encoder, an encoder to match my decoder, or two different IC's all together.

Thanks and I hope you guys can help me!!!

John

Reply to
jlwilson
Loading thread data ...

Ten inverters?

Good Luck! Rich

Reply to
Rich Grise

This has to be homework - if I were tasked to build a real 10-conductor cable tester, I sure wouldn't use a priority encoder.

Thanks, Rich

Reply to
Rich Grise

Good to see that you are designing around 21st Century components ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

I posted this to obtain some help.

I am new at design and I could use more than just your cut downs and insulting remarks.

If you cant say anything to help my design please keep your comments to yourself.

I am using a CPLD. I need to check wire by wire to assure that none of the wiring is crimped together. The cable is ribbon cable. I am using this same tester to test 10cond, 14cond, 16cond, and 20cond. I have written the code to do this but I am needing to finish the hardware.

Like I said before I am going to test a 20cond. cable and I dont need

40 inputs and outputs to do this.

If you have any better ideas I would like to hear them, just dont act like im stupid. This is my first design project away from college.

Reply to
jlwilson

"CD" parts are ancient history.

Ever hear of 74HC... ?

Maybe if you explained yourself thoroughly first time out of the box instead of giving only a partial component/thought list.

How/why did you choose CD40147B, etc., in the first place?

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

I chose the CD's only by doing a Digi-Key search and looking at the spec sheets. I have heard of 74HC. My lack of knowledge/experience about the part numbers are the culprit to this selection.

Sorry I didnt come out and say all of the project. I didnt want to say more than you wanted to hear and lose your attention/interest (the post was getting long as it was).

Thanks for the reply.

Reply to
jlwilson

I am not familiar with the parts directly, but would the negative logic problem be solved just by inverting the decoder output?

Also, the priority encoder approach may not be the most robust way to check the cable. If you need to look for shorts between the wires, there may be instances where the tester may not find a fault. Al

jlwils> I am wanting to take a signal and put it into a 4 to 10 decoder. The

Reply to
avitko

In my software I am counting up the inputs so it will step through the entire truth table for the encoder-decoders. If two are shorted together it will change the input coming from the decoder, the software will then catch this and fail the cable.

Reply to
jlwilson

I'll flout that by suggesting you learn the etiquette of posting on usenet. Google has a FAQ:

formatting link

Specifically, please quote what you're replying to.

Perhaps I've missed the point, but if you're using a CPLD, can't you simply alter your code to deal with the negative logic of the CD40147B?

Tim

--
Did I really still have that sig?
Reply to
Tim Auton

--- It'll change it, but you don't know whether it'll change it enough to detect it.

That is, with two shorted outputs at the encoder you're counting on the input voltage to the decoder to drop enough to be seen as a "0" instead of a "1". 4000 series logic outputs are pretty much a symmetrical totem pole, so a short will bring the input to the decoder to Vcc/2, which will still be a "1", I believe.

If you want the short to drop the voltage to a logic "0", then you need to use logic with an asymmetrical output structure, like

74LSXXX, or go to some other arrangement where a short between two or more conductors will cause the voltage on the input of the decoder to drop below the logic threshold of a "0".

How do you propose to make that happen?

Assuming that you can, In order to catch opens and shorts you'll need to make the near end conductors hot, one at a time, and then scan through the conductors on the far end looking for correspondence.

For 40 conductors you can do that with five 8 bit serial-in parallel-out shift registers (74LS164) on the near end, and five 8 bit parallel-in serial-out shift registers on the far end (74LS165).

Softwarewise, what you do is clear your '164s by running a string of zeros through them, and then clock a "1" into the first stage of the chain. Have that output drive conductor #1 of your cable, then parallel load what's on the far end of the cable into the chain of

165's. When that's done, serial clock the data in the 165's out while watching what's coming out. Since you know how many stages of shift register you have, and which conductor you made hot, you should see the output go high after a certain number of clocks. If you don't, or if you see more than one input go high during the scan, then there's a problem and once you finish that scan your software ought to be able to sort it out or just do a simple reject if that's all you're looking for.

The next step is to shift the "1" on the input side of the cable to the next conductor and scan the far side again, and so on, until you finish scanning the last conductor, when you'll be done.

-- John Fields Professional Circuit Designer

Reply to
John Fields

--
You\'re in luck!

There\'s a relatively easy way to do it, and that\'s to use 74HC4051
analog switches on the far end of the cable and a comparator on
their paralleled outputs to detect the short and output a "0" when
it does.

That also allows you to use 74HC164s instead of 74LS164s, and if you
EXCLUSIVE OR the output of the comparator and the serial output of
your chain of 164s, that\'ll give you the decode you\'re looking for,
since the output of the EXOR will be low when the comparator output
and the serial output from the 164 chain are the same, and high when
they\'re not.

I\'d be happy to work up a paper design for you and supply you with a
schematic, but since it\'s for a commercial application I\'d need to
charge for the work.  Email me if you\'re interested.
Reply to
John Fields

Well, one way or another you're going to need at least 20 outputs and

20 inputs. Why not just buy a CPLD with 40 I/O pins and be done with it?

It seens silly to skimp on CPLD pins and then go to a bunch of glue logic to expand the pin count back out to what you need physically.

Good Luck! Rich

Reply to
Rich Grise

Thanks for all the replies. I will use the 74HC series.

Reply to
jlwilson

The circuit I am using to detect the shorts seems to work great. Its not just straight wired, I would go more into detail on that section if my employer permitted it.

Thanks for the offer John but if it comes down to needing to pay someone they will get my supervisor (Masters in EE with 30 yrs design experience) to do this project.

I am wanting to do this without his help for as long as possible, so far it has been a great learning experience.

Thanks again and keep the comments and suggestions coming!!

Reply to
jlwilson

jlwilson scrobe on the papyrus:

Think more carefully about what you are trying to do. The possible faults that you will want to look for on a ribbon cable are open circuits and shorts between adjacent conductors. For example, it is impossible for an IDC connector on ribbon cable to short between pins 1 & 3, only pins 1 & 2 or pins 2 & 3 can sort together (unless the person assembling the cable has reversed one connector). Thus you can build a perfectly adequate ribbon cable tester with three outputs and three inputs.

--
John B
Reply to
John B

But he wants to test a whole cable in 3 seconds, not 3 minutes, IIUC.

Cheers! Rich

Reply to
Rich Grise

You haven't answered my question - if you have a CPLD, why do you want to put a limit on its pin count, only to use a bunch of random glue logic to expand the pin count back to what you needed in the first place? Just get a 144-pin (or so) CPLD, and do the whole thing in one chip. For example:

formatting link

Good Luck! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.