Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

How to remove the glitch like this?

I want to design a control module to scan a image sensor chip. In the design, it needs three clock signals as: load_ck, shift_ck, CK.

For scanning each pixel, it cost 32 basic clock cycles, during 0 to 5, load_ck will be basic clock signal and in else time keep 0. For load_ck, it only be basic clock in 8th cycle. For CK, it will be basic clock from 15 to 30. So my verilog code is as:

assign CK=(counterScan>14 && counterScan<31)? clk_200ns:1'b0;

assign load_ck=(counterScan<6)? clk_200ns:1'b0;

assign shift_ck=(counterScan==8)? clk_200ns:1'b0;

But in simulation, the result is as attachment. It is very clear there are glitches appear in the waveform. This phenomena may appear in some computational logic design. How can I remove this to make clear wave signal?

Thanks very much.

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Its unlikely that there are glitches on CK. However, your logic might be incorrect, and you are getting a single FPGA clock of CK high followed by low, followed by high for a larger number of FPGA clocks (or vice versa). You might interpret that as a 'glitch', however, its not, its a pulse that your synchronous logic created.

    Capture a Signal Tap II logic analyzer trace of CK and look at the signal with an oscilloscope.

    Cheers,

    Dave

    --- Quote End ---

    Yes, Dave, you are right. Actually, there is no glitches appear in simulation after I changed my code as I posted. The question I ask is I just assume there are still glitches.

    As you mentioned, now I understand is: if I make my design as I posted, in this case, there should not be any more glitches.