I'm trying to find an integrated circuit that implements the min function, as in
min(3, 4, 6) = 3 I'm having trouble with my search because the terms "min" and "minimum" are so heavily overloaded. Can someone please help me find either the IC itself, or the right search keywords?
I want to find a chip that maps N digital input pins to a smaller number of output pins that will carry the number of the lowest HIGH input pin. So, for instance, if it has 10 input pins and let's say that pins 3, 4, and 6 are all HIGH, the output will be 3 (which I can imagine would use either 4 digital output pins or a single analog pin).
The problem could also be that I'm thinking about this the wrong way. Here's some more context, if it helps:
I'm designing my first arduino project and I would like to make a USB midi controller. Specifically, I would like to make one that emulates an old monophonic synthesizer, meaning that even though it has 44 keys only one note will sound at a time. When multiple notes are pressed simultaneously only the lowest note will sound.
It seems like a shame to waste 44 inputs on the keys when only the lowest one will be active at any time. If I could find a solution to output the minimum HIGH pin out the 44 then I could reduce those 44 digital inputs down to 6 digital inputs or a single analog input. I realize that I can just buy a multiplexer and read all 44 pins through that, but I'm already buying a mux shield and an arduino mega in order to handle the huge number of inputs I will have (29 continuous and 59 discrete) so I would like to take advantage of the monophonic nature of the synth in hardware, rather than waste the inputs.
Thank you very much for your time!