集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 2074|回复: 3

VHDL syntax error at counter10.vhd(32) near

[复制链接]
CTT 发表于 2010-6-27 23:21:14 | 显示全部楼层 |阅读模式
Error (10500): VHDL syntax error at counter10.vhd(32) near text "process";expecting "if"

就是说
end process;
这句话有问题
我的源程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity counter10 is
   port (clk:in std_logic;
     reset:in std_logic;
     din:in std_logic_vector(3 downto 0);
     dout
       
ut std_logic_vector(3 downto 0);
     c
       
ut std_logic);
end counter10;

architecture Behavioral of counter10 is
signal count:std_logic_vector(3 downto 0);
begin
dout<=count;
process(clk,reset,din)
begin
if reset='0' then
  count<=din;
  c<='0';
  else if rising_edge(clk) then
    if count="1001" then
     count<="0000";
     c<='1';
     else
     count<=count+1;
     c<='0';
     end if;
   end if;
end process;
end Behavioral;

请帮忙指点一下怎么改
interi 发表于 2010-6-28 01:10:29 | 显示全部楼层
错误很简单!<br>
但不太容易看!<br>
错误就是 ELSE IF<br>
要么改成IF-ELSIF-END IF组合<br>
要么再加一个END IF;
usb 发表于 2010-6-28 02:34:13 | 显示全部楼层
else if 改成 ELSIF 啊~~~~~~~<br>
elsif rising_edge(clk) then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;elsif count="1001" then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;count&lt;="0000";<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;c&lt;='1';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; else<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;count&lt;=count+1;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;c&lt;='0';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; end if;
interig 发表于 2010-6-28 03:55:15 | 显示全部楼层
我在软件上试了一下,这样可以运行,本人也是刚学maxplus2的菜鸟啊~~~~~~<br>
library ieee;<br>
use ieee.std_logic_1164.all;<br>
use ieee.std_logic_arith.all;<br>
use ieee.std_logic_unsigned.all;<br>
entity counter10 is<br>
&nbsp; &nbsp;&nbsp; &nbsp; port (clk:in std_logic;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; reset:in std_logic;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; din:in std_logic_vector(3 downto 0);<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; dout
       
ut std_logic_vector(3 downto 0);<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; c
       
ut std_logic);<br>
end counter10;<br>
<br>
architecture Behavioral of counter10 is<br>
&nbsp; &nbsp;&nbsp;&nbsp;signal count:std_logic_vector(3 downto 0);<br>
begin<br>
&nbsp; &nbsp;&nbsp;&nbsp;dout&lt;=count;<br>
<br>
process(clk)<br>
begin<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if rising_edge(clk) then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if count="1001" then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;count&lt;="0000";<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;c&lt;='1';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; else<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;count&lt;=count+1;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;c&lt;='0';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; end if;<br>
&nbsp; &nbsp;&nbsp; &nbsp; end if;<br>
end process;<br>
end Behavioral;
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-12-24 10:26 , Processed in 0.060810 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表