Electronic – Crossing a single-cycle spike signal from a fast clock domain to a slower one

clockfpgavhdl

I have a 1-bit signal coming from a part of my circuit that is running on a 40 MHz clock. The signal is mostly 0, except it is 1 for a single 40 MHz-cycle every ~million cycles.

Another part of my circuit is running on a 1 MHz clock. I would like to do some synchronous processing on the signal described above in this part of my circuit. What is the correct way to turn the single-cycle 40 MHz signal into a single-cycle 1 MHz signal?

In case that matters, both the 40 MHz and the 1 MHz clocks are output from the same clock manager driven by the 32 MHz clock on my dev board, so they should be phase-locked.

Best Answer

Convert that pulse to a level change (invert the output of a flip flop whenever a pulse is generated), pass that across with a couple of flip flops for synchronization, and convert the level change back to a pulse with a flip flop and XOR gate. This is called pulse synchronization with a toggle synchronizer, and it is a very common technique. See: http://www.edn.com/electronics-blogs/day-in-the-life-of-a-chip-designer/4435339/Synchronizer-techniques-for-multi-clock-domain-SoCs .