Logic gate on negative signals
This would be easier if the schematic had reference designators.

Both circuits have issues.  In the upper schematic, (as above) an NPN bipolar such as a 2N4401 or 2N3904 as a common-base amplifier will work more "crisply".  Base to GND, emitter to the diodes, collector to the output.  To prevent the output from going below GND, add another diode in series with the collector and take the output from the diode/1K node.

In the lower schematic, two things.  First, you cannot pull an opamp input 20 V below its negative rail.  Add a diode from the inverting input to GND, anode to GND.  This will clip the input at approx. -0.6 V.  Also, is there a reason why the resistor values are so low?  Power dissipation in the 1K going to the diodes node is 0.4 W, requiring a 1 W part.  Consider raising the values of all resistors to 10K.

This applies to the first schematic also.  You would be pulling approx. 20 mA through the base-emitter junction; that is unnecessarily high and affects long-term reliability.

Second, not all opamps can tolerate even -0.6 V below the negative rail on an input.  Also, not all opamps can drive TTL logic levels when powered from +5 V.  Read all of the datasheets and choose carefully.