This free FPGA clock calculator does two jobs. For a simple clock divider it gives the divide ratio, the counter width, the exact output frequency and error, and ready-to-paste Verilog for a clock-enable counter. For a PLL or MMCM it searches every valid multiply (M), input divide (D) and output divide (O) combination within the VCO and phase detector limits and lists the closest settings to your target frequency — handy for VGA, HDMI, Ethernet and memory clocks on Xilinx, AMD, Intel and Lattice FPGAs.
Clock divider and PLL formulas
Divider: N = round(Fin ÷ Ftarget) · Fout = Fin ÷ N · counter bits = ⌈log₂ N⌉
PLL / MMCM: Fpfd = Fin ÷ D · Fvco = Fin × M ÷ D · Fout = Fvco ÷ O
Error (ppm) = (Fout − Ftarget) ÷ Ftarget × 10⁶
Worked example
For 25.175 MHz from a 100 MHz board clock on a 7-series MMCM, the best integer setting is M = 34, D = 3, O = 45: VCO = 100 × 34 ÷ 3 = 1,133.333 MHz, and 1,133.333 ÷ 45 = 25.1852 MHz, an error of 405 ppm.
PLL settings for common clocks (100 MHz input, 7-series MMCM)
| Use | Target MHz | M | D | O | Fout MHz | Error ppm |
|---|---|---|---|---|---|---|
| VGA 640×480 @ 60 Hz | 25.175 | 34 | 3 | 45 | 25.1852 | 405 |
| SVGA 800×600 @ 60 Hz | 40 | 12 | 1 | 30 | 40 | 0 |
| 720p / 1080i video | 74.25 | 49 | 6 | 11 | 74.2424 | -102 |
| 1080p @ 60 Hz | 148.5 | 52 | 5 | 7 | 148.5714 | 481 |
| DDR3 / memory interface | 200 | 12 | 1 | 6 | 200 | 0 |
| Gigabit Ethernet GMII | 125 | 45 | 4 | 9 | 125 | 0 |
Limits are typical Xilinx 7-series values for the -1 speed grade (MMCM VCO 600–1200 MHz). Other families and speed grades differ — check the datasheet, choose Custom limits, and confirm the result in the vendor clocking wizard. The MMCM also supports fractional M and O values in 1/8 steps, which this integer search does not use.
Related calculations
- Check whether your logic meets timing at the new clock with the timing slack calculator.
- Crossing between two clock domains? Size the buffer with the FIFO depth calculator.