I'm working on a design that involves a lot of max functions (and max functions as arguments to other max functions).
In an effort to simplify the hardware design I was wondering how max is implemented in hardware?
Mathematically, Max(a,b) can be represented as [(a + b) + abs(b – a)]/2.
Is this how its implemented in hardware? (i.e. in stages; addition, bit shift division, etc.)
If so, how is the absolute of the difference calculated?
Best Answer
A very simple approach would be to implement (a>b)?a:b. a>b can be implemented by starting at the left and check each bit pair of (a,b):
When you know which one is the highest you can select that one by a 2N->N mux.
With some clever tricking the checking of the bit pairs can be combined with the muxer for the same bit pair.