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

I have seen from various sources which say that a NOT gate cannot be used to achieve an 180-degree phase shift. Is this claim true?

Edit: The question is definitely sounding unclear because that is how it was worded, but one thing I missed was it was asked in the context related to FPGA's. So I assume we are dealing with digital signals here. Anyways giving a sine wave as an input to the NOT gate would change the shape of the output itself so I guess there would be no question of comparing/calculating the phase difference. The solution given was to use a DCM in an FPGA and it was explicitly mentioned not to use a NOT gate, but I don't understand why it won't work because inverting a wave is definitely an 180-degree phase change right? Please correct me if I'm wrong!

• What kind of signal? Digital, analog? Link to source, please. – Transistor Jul 23 '16 at 12:13
• NOT gates are logical elements, 180° phase shift is a pretty analog concept; it's totally unclear how you mentally combined these two pretty disparate things. You won't find a NOT gate in analog circuits, and you won't find a 180° phase shift in digital lines. There's conceptual similarities between 180° phase shifting an analog harmonic signal (because it inverts it) and a NOT gate, but these really are two things from two different worlds. So please give some background, otherwise your question will remain unclear and might/will be closed. – Marcus Müller Jul 23 '16 at 12:23
• For a square wave, yes. Beyond that, maybe. – Tom Carpenter Jul 23 '16 at 16:03
• @Marcus Müller: Phase is a quantity that can very well be defined for digital signal. There is absolutely NO reason why it can not be applied to digital signals just as it can be applied for analog signals. There is not just a "conceptual similarity". – Curd Jul 24 '16 at 15:47
• @Curd I do agree; I'm an SDR guy myself, so yeah, of course phase has a meaning for digital signals, but the point is that OP doesn't make a difference here; when describing phase, we talk about what's essentially a rotation due to temporal delay; when we talk about NOT, we really mean inversion. – Marcus Müller Jul 24 '16 at 19:17

5 Answers

Since no answer so far (and one has a score above 20!) actually mentions FPGAs, I'll add the answer I think you are looking for. You can't invert a clock on an FPGA with logic for various reasons:

1. Skew. The inversion is not instantaneous, so there would be a transitional time with both clocks matching. You probably don't want this.

2. Architecture. FPGA's logic elements have dedicated clock input lines that are independent of the data lines. To route from data to clock nets involves connections that are suboptimal.

If you are trying to get an inverted clock inside the IC, you'll have to use one of the architecture's native clock modules.

If you are trying to drive an output with an inverted clock, the major vendors all have DDR logic that you can use to send the "data" of a continuous 010101 at "double data rate" which is actually the clock inverted. The dedicated circuits will handle any corrections needed. This lets you avoid using global clock resources for the inverted clock and also gives you a way to invert the clock in the field with a control register.

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.

• In the case where the signal is a digital clock signal (where either the duty cycle is usually expected to be 50% or vary within some band that is symmetrical around 50% and such variations are deemed not significant to the operation of the system that receives the signal), then I would say that an inverter is providing a phase shift of 180 degrees. Agree that it is not doing so in any other circumstance, however... – Jules Jul 23 '16 at 13:30
• You might want to mention that even in the case of a squarewave with a 50% duty cycle, the phase shift will not be exactly 180 degrees due to the delay through the NOT gate. For this reason, when it is desirable to use this method to obtain an inverted signal (e.g. a clock), it is often a good idea to add a buffer (non-inverting gate) with similar characteristics (delay, drive, etc.) to the original signal so that the resulting signals have more closely matched characteristics (closer to 180 degree phase delay, etc.). – Makyen Jul 23 '16 at 15:21
• This is probably a bad idea but it should be possible to phase shift a sine wave by inverting the input, and then smoothing the input with a frequency filter. If you know the frequency, a simple resonator should do. A high enough order RC low-pass might do, too, but it will still be crucial to get the cutoff right. – John Dvorak Jul 23 '16 at 16:22

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.

• What sort of feedback circuit do you propose to use in a digital logic circuit? – user2943160 Jul 23 '16 at 15:43
• @user2943160 Current starved inverter chains - used to form delays in DLLs. Granted phase detectors are also needed. – Tom Carpenter Jul 23 '16 at 16:04

A practical NOT-gate will invert the input, but after some finite delay.

Your digital signal from one positive edge to another is 360 degrees, the phase shift provided by the NOT-gate will be more than 180 degrees.