process(clk,rst) begin if rst = '1' then cnti <= (others => '0'); clkd <= '0'; elsif clk = '1' and clk'event then if cnti = 39999999 then cnti <= (others => '0'); else cnti <= cnti + 1; end if; if cnti = 39999999 then clkd <= not clkd; end if; end if; end process;