Can a NOT gate be used to achieve 180 degree phase shift?
What is 180 degrees phase shift?

When the signal is a sine wave, a 180 degrees phase shift delays the signal for half the period of that sine wave, the sine wave then looks inverted:



Can an inverter do this? No, because it has signal gain, the output would be a square wave, not a sine.

When the signal is a square wave with a 50% duty cycle, then something similar happens as with the sine wave:

Can an inverter do this? Yes





But now let's look at a square wave with a 25% duty cycle,
and see what happens when I would NOT that signal:







simulate this circuit &ndash; Schematic created using CircuitLab



So you see that it is indeed possible to use a NOT gate (inverter) to 180 degree phase shift a signal, but that only works on a square wave with a 50% duty cycle.

I would not use the term "180 degrees phase shift" in the context of digital signals and NOT gates. I would call that inverting a (digital) signal.

Calling this 180 degrees phase shift is confusing and wrong in my opinion because it is not a phase shift, but an inversion.