I need circuit to choice between two voltages. So, circuit has two input terminals 12V,24V and one output terminal. If there is no 12V on input (floating) - output is connected to 24V, and if there is 12V - output connected to 12V. Is it possible to design such circuit without comparators? I think there should be P- channel mosfet on 24V.
For an electronic switch you can use the circuit below :
R5/R6 create a voltage divider that keeps M2 gate at about 9.5-10v (if the 24v can be much lower you can use a zener instead of the divider).
When the 12v supply is applied then the source of M2 becomes 12v and Vgs becomes almost 0 (slightly negative actually) which turns the mosfet off. That leaves the lower side of R2 floating (high impedance to ground) so R1 works as a pull up with Vgs=0 and M1 turns off.
The two Schottky diodes are used to prevent the current flowing from 12v to 24v and from 24v to the M2 gate (or the 12v during the M1 transition).
Use a SPDT Relay. Attach the coil to the incoming 12volts. Coil rating needs to be 12v of course. NC contact connects to 24v. NO contact to 12v. Contact pole (aka common) output to your load.