我建议你这样写: LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY mycounter IS PORT ( Clk : IN STD_LOGIC; Count : OUT std_logic_vector(5 downto 0)); END mycounter; ARCHITECTURE mycounter_architecture OF mycounter IS BEGIN cnt:PROCESS(Clk) signal temp:std_logic_vector(5 downto 0); BEGIN IF(Clk'EVENT AND Clk='1') THEN temp:=temp+1; END IF; Count<=temp; END PROCESS cnt; END mycounter_architecture; 另外你可以通过QQ767914192 或:vhdl_flanix@163.com 与我联系. ... ...
设计文件如下: LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY mycounter IS PORT ( Clk : IN STD_LOGIC; Count : OUT INTEGER RANGE 0 TO 63 ); END mycounter; ARCHITECTURE mycounter_architecture OF mycounter IS BEGIN cnt:PROCESS(Clk) VARIABLE temp:INTEGER RANGE 0 TO 64; BEGIN IF(Clk'EVENT AND Clk='1') THEN temp:=temp+1; IF(temp>=64) THEN temp:=0; END IF; END IF; Count<=temp; END PROCESS cnt; END mycounter_architecture; ... ...