Power Multiplexer 36V 4A

Hello

I am trying to find a chip or circuit that can help me designing a XOR function (power multiplexer) capable to handle 3 Vin of 36V to a Vout of 36V with a maximum current flowing trough of 4A.

I have some switching criteria as follow:

Vin 3 power adapter
Vin 1: battery pack 1

Vin 2: battery pack 2

If Vin 3 is on => XOR output = Vin 3

If Vin 3 is off => XOR output is is on Vin 1 or Vin 2 based on voltage (the one with the highest voltage got priority)

Does anybody got idea about how I can achieve this ?

The two batteries can be combined with an “ideal diode” this is a FET that is controlled to operate like a diode ( allows current in one direction only) In this case current would be taken from the highest voltage battery. If the power adapter voltage is higher than the battery, then just use a diode on the power adapter. So highest voltage wins, power adapter> highest voltage battery.