Electronics > Projects, Designs, and Technical Stuff
Find highest value of 4 inputs without microcontroller?
(1/12) > >>
petersanch:
Hi All,
I have 4 analog inputs and wish to find which one out of the 4 has the highest voltage. A TTL output is preferred. Feels as if there should be an IC that does this. Are there clever ways of doing this without a micro or A2D?

Cheers!
mark03:
Six comparators followed by some digital logic?

(One comparator for every signal pair:  AB, AC, AD, BC, BD, CD.  Then work out the boolean logic for your desired output, whether 1-of-4 or two-bit binary encoding.)
helius:
So with 4 inputs, there are 6 relevant comparisons: A vs B, C vs D, A vs C, B vs D, A vs D, B vs C.
out(A) = (A>B)∧(A>D)∧(A>C)
out(B) = (A<B)∧(B>D)∧(B>C)
out(C) = (C>D)∧(B<C)∧(A<C)
out(D) = (C<D)∧(B<D)∧(A<D)
You can factor the comparisons into sums of terms, too.

How about two LM339 quad comparators, with the outputs ran into a 74HCT132 quad 4-input NAND?
unitedatoms:
For positive only voltages, connect each input to anodes of leds of 4 optocouplers. Tie all led cathodes to single grounded resistor load. The ttl outputs of optos will provide 4 bit code. Where possible most expected values are 0001, 0010,  0100 and 1000. Other values must be decided upon too, use code into any combinatorial manner, for example 2 x 16 inputs demuxes with hardwired inputs if 2 bit output is required.
bson:
I second the optocoupler idea.  The LEDs may differ ever so slightly in forward voltage, so that will be your main source of inaccuracy.



Ra//Rb biases the LEDs, and if you want to bias at -Vf = -2.5V then Vss < GND - Vf < -2.5V.   If you don't care about biasing just remove Ra and replace Vss with ground.

Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod