こんにちは、VHDL を使用して簡単なマシンを実装しようとしていますが、ボタンの押下をデバウンスする必要があります。私の問題は、デバウンスをどこに実装すればよいかわからないことです。私の現在の仕事は次のようなものです。
process(clk)
begin
if(clk' event and clk = '1') then
if rst = '1' then
curr_state <= state0;
else
curr_state <= next_state;
end if;
end if;
end process;
process(curr_state, op1,op0,rst) --here op1,op0 and rst are all physical buttons and I need to debounce op1 and op0
begin
if rst = '1' then
...some implementation
else
...implement the debounce logic first
...process some input
case curr_state is
when state0=>...implementation
...similar stuff
end case;
end process;
自分のやり方が正しいかどうかはわかりません。2番目のプロセスでは、最初の処理をこのように入れるか、state0ブロックのときに中に入れますか? また、デバウンスの処理はカウントが必要なので、このようにケースブロックの外に出しますか?ありがとうございました!