我希望获得有关如何在此代码中添加清除或重置输入的帮助,因此在clr输入为1
时,the_output_S会随时重置为0000
。这段代码可以很好地运行我需要的真值表,但是我似乎无法弄清楚任何正常工作的清晰输入。我尝试添加一个带有clr_S选择the_output_S <= "0000"
的{{1}},1
的{{1}}和其他the_output_S
的选择。我只是不确定当clr为0时如何指向我的真值表。任何有关如何添加此建议将不胜感激。谢谢
0
答案 0 :(得分:1)
一种方法是使结果成为内部值,然后在输出最终值之前使用clr
覆盖它,例如:
...
signal the_output_S_pre : std_logic_vector (3 downto 0);
signal the_output_S : std_logic_vector (3 downto 0);
...
with the_input_S select
the_output_S_pre <=
...
the_output_S <= the_output_S_pre when (clr = '0') else "0000";
...