library IEEE; use IEEE.STD_LOGIC_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;
entity CLK_DIV is port( CLK : in STD_LOGIC; RST : in STD_LOGIC; CLK_D : in STD_LOGIC ); end CLK_DIV;
architecture CLK_DIV of CLK_DIV is signal cnt : std_logic_vector (25 downto 0); begin process(clk,rst) begin if rst = '1' then cnt <= (others => '0'); clk_d <= '0'; elsif clk = '1' and clk'event then if cnt = 39999999 then cnt <= (others => '0'); else cnt <= cnt + 1; end if; if cnt = 39999999 then clk_d <= not clk_d; end if; end if; end process; end CLK_DIV;
сброс положен в любой цифровой схеме. Хотя можно и без него. Опять таки для моделлирования.