Skip to main content

Report this content

We want the Dreams coMmunity to be a safe, diverse and tolerant place for everyone, no matter their age, gender, race, sexual orientation or otherwise. If you believe this content to contradict these principles, you can file a report for our coMmunity teams to investigate.

Note that misuse of the reporting tool will not be tolerated.

Item being reported:

A forum post by Agarwel

I need to compare 4 values and select smallest one, but ignore inactive 0 inputs. So if the inputs are 0,2,5,9, the result should be 2. Only if it is 0,0,0,0 the result should be zero.
I know I can use AND gate to find lowest signal. But the zeroes are making it tricky.

So far I made it in a way that if input is 0 i change it to 1000. And if the result value is 1000, I change it to 0. But that means Im running multiple operation 5 times to midify values. And because I need to copy this chip many times (ideally hundrets), Im looking for most optimized solution to reduce thermo usage.

Do you have better ideas how to do it with less calculations?

Thanks

Oh dear! Your browser is either unsupported or there has been a problem loading the page.