|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity counter is
port(
clk:in std_logic;
reset:in std_logic;
ce,load,dir:in std_logic;
din:in std_logic_vector(3 downto 0);
count: inout std_logic_vector(3 downto 0));
end counter;
architecture Behavioral of counter is
begin
process(clk,reset)
begin
if reset='1' then
count<="0000";
else if clk='1' and clk'event then
if load='1' then
count<=din;
else
if ce='1' then
if dir='1' then
count<=count+1;
else
count<=count-1;
end if;
end if;
end if;
end if;
end process;
end Behavioral;
语法编译的时候说ERROR:HDLParsers:164 - "E:/example/fpga/counter/counter.vhd" Line 58. parse error, unexpected PROCESS, expecting IF
怎么回事 请高手解决 |
|