我正在研究音序器,但我不知道如何增加一些输出信号。在状态 1 ( S1
) 我想增加ram_add_wr
(在每个时钟周期)。
clocked_process:PROCESS(clk,rst)
VARIABLE count: INTEGER RANGE 0 TO 32;
BEGIN
IF (rst = '0') THEN
pr_state <= idle;
count := 0;
ELSIF (clk'event AND clk='1') THEN
count := count+1;
IF (count>=timer) THEN
pr_state <= nx_state;
count := 0;
END IF;
END IF;
END PROCESS;
PROCESS(pr_state, en)
BEGIN
CASE pr_state IS
WHEN idle =>
timer <= 1;
IF (en = '1') THEN
sig_ram_add_wr <= "00000";
nx_state <= s1;
ELSE
nx_state <= idle;
sig_ram_add_wr <= "00000";
END IF;
WHEN s1 =>
timer <= 32;
IF (en ='1') THEN
--timer <= 1;