Is there a 16 to 4 one-hot simple encoder IC chip?

The function you are looking for is normally referred to as a Priority Encoder.

A priority encoder can cope with more than one signal being active and still give the correct result for the highest numbered active input. If your system can guarantee that one and one input only will be active you can use a simpler solution as suggested by Dave Tweed in the comments, however such solutions can give a completely incorrect result if two or more inputs are active.

As far as I know there has never been an off-the-shelf device to implement a 16-input priority encoder.

An 8-bit version has been around for many years. One of the current versions is SN74HC148.

@Marku points out that the data sheet (link above) has a 16-bit example using two such devices together with 4x 2-input AND gates requiring three packages in total.

These days it is more common to implement functionality like this either in software within a microcontroller or in programmable hardware in Verilog/VHDL.

Can you describe your system in more detail to see which solution would fit better?


I don't know whether such a device exists, but:

Approaches in lieu of a 16x "one hot" -> 4 bit output IC

Serialize, count clocks until the 1 appears

  1. Use a parallel-to-serial shift register(s) to convert your one-hot to a sequence of 15 zeros and 1 one in the right place. Clock that shift register and feed its output into
  2. a 4 bit or more (you'll probably find 8 bit) counter with parallel output that you clock with the same clock, but latch on the data input

Programmable logic

Your problem might very well cheapest be solved with a CPLD or even a GAL

Memory IC

Use Memory IC with parallel address bus and parallel data output bus. Example IC

Simply store right 4-bit value at right 16bit address

ROM in diode logic

You can basically do a lookup table matrix in PCB traces. Will require lots of discrete diodes (4 output bits being ORs of 8 input bits, each, so 32 if my math is right). But it's "logically" easy.

Assume you have an 8-input "OR" gate (that would be 8 diodes with a common cathode). Then, the highest output would be "Is it any of the second half of inputs", right? So, you just connect that OR to these. Similarly, your lowest output would be "any of every other input", so you connect these to another 8xOR gate.

Fun fact: there's 8-diode common-cathode components, and they're pretty cheap! Just use TVS clamping diode arrays (example) and an elegant PCB layout. If your input voltages aren't higher than the TVS' clamping voltage, you'll have to go for 8 quad common-cathode diode arrays.

ROM using discrete gates

Same as above, but use ready (probably 74-series) logic gates (ORs, or actually just buffers with output resistors).

Resistor ladder DAC + parallel output ADC

Assuming constant voltage inputs: build a resistor ladder:

schematic

simulate this circuit – Schematic created using CircuitLab

Hint: there's resistor networks (many resistors in the same package) that make this less of a pain to solder.

Vout is proportional to the input that is currently hot.

Use an ADC with a parallel output to read that out.

Strangly, this might be a relatively simple and cheap approach, considering 8-bit parallel-out ADCs are readily available and not that expensive.

Tags:

Encoder