一个VHDL的小问题下面的程序流程,可是老是运行不出来,不知道什么原因
哪位大哥可以帮忙看一下:
附上代码如下:
library ieee;
use ieee.std_logic_1164.all;
entity count1 is
port(clk,clr,en:in std_logic;
qa,qb,qc,qd:out std_logic);
end count1;
architecture rtl of count1 is
signal count: std_logic_vector(3 downto 0);
begin
qa <=count(0);
qb <=count(1);
qc <=count(2);
qd <=count(3);
process(clk,clr)
begin
if(clr='1')then
count <="0000";
elsif(clk'event and clk='1')then
if(en='1')then
if(count="1011")then --如果此时的值为12的话就再从头开始
count <="0000";
else
count <=count+'1';
end if;
end if;
end if;
end process;
end rtl;