I came up with this but I am not sure if this will give me 25Mhz and I can't think of a way to test it. Can someone tell me if this is right?
1 | signal clock_25MHz : std_logic; |
2 | signal counter : integer; |
3 | |
4 | process(clk,counter,clock_25Mhz) |
5 | constant max_count : integer := 3; --divide 100 by 4 (0-3) |
6 | begin
|
7 | if (rising_edge(clk)) then |
8 | counter <= counter + 1; |
9 | if (counter = max_count) then |
10 | clock_25Mhz <= not clock_25Mhz; |
11 | counter <= 0; |
12 | end if; |
13 | end if; |
14 | end process; |