meganwhite
Technical User
Hi guys I am using a code and getting glitch for the signal clrcntr, how can I remove the glitch?
The program is
lib...
..
...
process(clk, rst, clrcntr, count, cntr, cntr_en, etr, clr_32)
begin
if (rst = '1' or clrcntr = '1') then
cntr <= "0000";
clrcntr <= '0';
etr <= '0';
elsif (clk'event and (clk = '1')) then
if (cntr_en = '1') then
cntr <= cntr + 1;
end if;
if (count = "00" and cntr = "1111" then
etr <= '1';
elsif (count = "01" and cntr>= "0111" then
etr <= '1';
elsif (count = "10" and cntr>= "0011" then
etr <= '1';
end if;
if (etr = '1') then
eofr <= '0';
clrcntr <= '1';
end if;
end process;
The program is
lib...
..
...
process(clk, rst, clrcntr, count, cntr, cntr_en, etr, clr_32)
begin
if (rst = '1' or clrcntr = '1') then
cntr <= "0000";
clrcntr <= '0';
etr <= '0';
elsif (clk'event and (clk = '1')) then
if (cntr_en = '1') then
cntr <= cntr + 1;
end if;
if (count = "00" and cntr = "1111" then
etr <= '1';
elsif (count = "01" and cntr>= "0111" then
etr <= '1';
elsif (count = "10" and cntr>= "0011" then
etr <= '1';
end if;
if (etr = '1') then
eofr <= '0';
clrcntr <= '1';
end if;
end process;