Altera_Forum
Honored Contributor
14 years agoneed help: frequency div
hello everyone, i am trying to do a frequency divider which convert 33.333Mhz to 1hz frequency, the code don't show any error after compilation, but my result is all zero after simulation. can anyone please help me
the following is the code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity clk_gen is port( Clk : in std_logic; Clk_mod : out std_logic ); end clk_gen; architecture Behavioral of clk_gen is signal clkdiv : unsigned(24 downto 0); signal clk1hz : std_logic; begin process(Clk) begin if rising_edge (Clk) then clkdiv <= clkdiv + 1; end if; end process; clk1hz <= clkdiv(24); Clk_mod <= clk1hz; end Behavioral;