S
Shannon
Guest
Amit might be trying to create a simple divided clock. Here is an
example of one of the ten thousand ways of making a divided clock.
This is a divide by 4 clock: (DIVISOR := 4)
PROCESS (MClk, Reset)
BEGIN
IF (Reset = '1') THEN
clk_per_cur <= (OTHERS => '0');
ELSIF (rising_edge (MClk)) THEN
clk_per_cur <= clk_per_next;
END IF;
END PROCESS;
clk_per_next <= (OTHERS => '0') WHEN clk_per_cur = (DIVISOR-1) ELSE
clk_per_cur + 1;
Shannon
example of one of the ten thousand ways of making a divided clock.
This is a divide by 4 clock: (DIVISOR := 4)
PROCESS (MClk, Reset)
BEGIN
IF (Reset = '1') THEN
clk_per_cur <= (OTHERS => '0');
ELSIF (rising_edge (MClk)) THEN
clk_per_cur <= clk_per_next;
END IF;
END PROCESS;
clk_per_next <= (OTHERS => '0') WHEN clk_per_cur = (DIVISOR-1) ELSE
clk_per_cur + 1;
Shannon