我是VHDL(以及一般的数字电路)的新手,我正在尝试使用BCD样式块实现两位数的计数器.在这个电路的外部会有按钮,当按下时,按钮会使感兴趣的数字上升一个(很像闹钟).这是一个异步操作,在某种形式的编辑模式(外部强制执行)时会发生.我写的代码没有"elsif rising_edge(digitUp1)then"和"elsif rising_edge(digitUp1)然后"阻止工作正常,但包含它们失败了.我真的不知道为什么它不起作用或我如何解决它.继续得到诸如"无法在此时钟边缘上实现分配寄存器"之类的错误,"可以"
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
-- ToDo: ENFORCE ON ALL COUNTERS (externally) LOGIC TO PAUSE AT MAX/MIN
entity MinuteCounter is
port( clockIn, digitUp1, digitUp2, reset, counting, countUp : in std_logic;
clockOut : out std_logic;
BCD1, BCD2 : out std_logic_vector(3 downto 0));
end MinuteCounter;
architecture structure of MinuteCounter is
signal count1, count2 : std_logic_vector(3 downto 0);
signal carryOut : std_logic;
begin
process( clockIn, digitUp1, digitUp2, countUp, reset, counting)
begin
-- Asynchronous reset
if reset = '1' then …Run Code Online (Sandbox Code Playgroud)