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 – 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.
The claim is misleading. An inverter deals with digital signals and digital signals contain frequency harmonics that meander off to infinity (theoretically). Take a square wave for example: -
The one above is very approximate showing only the fundamental, third, fifth and seventh harmonics.
If you inverted this square wave you could certainly say the fundamental is phase shifted 180 degrees. Then, if you (say) took the 3rd harmonic in isolation, and looked how that phase shifted it would also be phase shifted by 180 degrees but, in relation to the fundamental that phase shift is only 60 degrees.
The claim is correct in some respects but it's misleading in others.
A not gate has too much gain to provide a clean 180 degree phase shift but with the right amount of negative feedback some not gates can do it.