page_title: Phase detector
section_title: Digital phase detector
hierarchical_section_title: Phase detector / Types / Digital phase detector
caption_attribution_description: English: A schematic of a Pass-Transistor Phase Frequency Detector implemented in CMOS. This is commonly used in a Charge Pump Phase Locked Loop (PLL).
context_page_description: A phase detector or phase comparator is a frequency mixer, analog multiplier or logic circuit that generates a voltage signal which represents the difference in phase between two signal inputs. It is an essential element of the phase-locked loop.
  Detecting phase difference is very important in many applications, such as motor control, radar and telecommunication systems, servo mechanisms, and demodulators.
context_section_description: A phase detector suitable for square wave signals can be made from an exclusive-OR (XOR) logic gate. When the two signals being compared are completely in-phase, the XOR gate's output will have a constant level of zero. When the two signals differ in phase by 1°, the XOR gate's output will be high for 1/180th of each cycle — the fraction of a cycle during which the two signals differ in value. When the signals differ by 180° — that is, one signal is high when the other is low, and vice versa — the XOR gate's output remains high throughout each cycle.
  The XOR detector compares well to the analog mixer in that it locks near a 90° phase difference and has a square-wave output at twice the reference frequency. The square-wave changes duty-cycle in proportion to the phase difference resulting. Applying the XOR gate's output to a low-pass filter results in an analog voltage that is proportional to the phase difference between the two signals.  It requires inputs that are symmetrical square waves, or nearly so.  The remainder of its characteristics are very similar to the analog mixer for capture range, lock time, reference spurious and low-pass filter requirements.
  Digital phase detectors can also be based on a sample and hold circuit, a charge pump, or a logic circuit consisting of flip-flops. When a phase detector that's based on logic gates is used in a PLL, it can quickly force the VCO to synchronize with an input signal, even when the frequency of the input signal differs substantially from the initial frequency of the VCO. Such phase detectors also have other desirable properties, such as better accuracy when there are only small phase differences between the two signals being compared. This is because a digital phase detector has a nearly infinite pull-in range in comparison to an XOR detector.
caption: An example CMOS digital phase frequency detector. Inputs are R and V while the outputs Up and Dn feed to a charge pump.
exif: {}