xman24
Junior Member level 2
Hi..
I am doing a bit stuff detector module for my project.
assign bit_stuff_detect= (ONES_COUNT==3'd6 && input==1'b0) ? 1'b1:1'b0;
assign bit_stuff_error= (ONES_COUNT==3'd6 && input==1'b1) ? 1'b1:1'b0;
always@(posedge clk)
{
...................................
ONES_COUNT<=ONES_COUNT+1; // Number of ones countiing on posedge of clk
................................
................................
................................
}
So in the above code I am getting a glictch with logic one for a small instance of time when the input is 1111110 on the bit_stuff_error line in timing diagram. i got bit_stuff_detect high as per combinational logic..but the unwanted glitch is there in output!!! Pls hep....I know the problem is with the usage of combinational logic along with clocked logic(here it is ONES_COUNT which works with posedge clk).
input will change only in posedge of clk.
:roll: Please help,How to avoid the glitch that happened in above case... please be specific to the above example when you reply...
Thanks...
I am doing a bit stuff detector module for my project.
assign bit_stuff_detect= (ONES_COUNT==3'd6 && input==1'b0) ? 1'b1:1'b0;
assign bit_stuff_error= (ONES_COUNT==3'd6 && input==1'b1) ? 1'b1:1'b0;
always@(posedge clk)
{
...................................
ONES_COUNT<=ONES_COUNT+1; // Number of ones countiing on posedge of clk
................................
................................
................................
}
So in the above code I am getting a glictch with logic one for a small instance of time when the input is 1111110 on the bit_stuff_error line in timing diagram. i got bit_stuff_detect high as per combinational logic..but the unwanted glitch is there in output!!! Pls hep....I know the problem is with the usage of combinational logic along with clocked logic(here it is ONES_COUNT which works with posedge clk).
input will change only in posedge of clk.
:roll: Please help,How to avoid the glitch that happened in above case... please be specific to the above example when you reply...
Thanks...