锁存变量-VHDL

时间:2019-03-17 22:06:09

标签: compiler-errors vhdl

我正在使用FSM为4x4键盘实现去抖功能,该代码的第六行为我提供了一个闩锁(在state <= next_state中)

process(clk,reset)
    begin
    if reset = '1' then
        state      <= Wait0;
    elsif rising_edge(clk) then
        state <= next_state;
        if next_state = Counting then
            count <= count + 1;
        else
            count <= 0;
        end if;
    end if;
end process;

有趣的是,我在另一个组件中有相同的语句,并且没有给我错误。我在另一个过程中分配变量next_state。可能是什么问题?

0 个答案:

没有答案