在线咨询 切换到宽版
eetop公众号 创芯大讲堂 创芯人才网

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 2685|回复: 4

这个哪里错误 我是新手

[复制链接]
发表于 2009-9-1 16:20:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
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
怎么回事 请高手解决
发表于 2009-9-1 18:58:28 | 显示全部楼层
add end if before end process.
回复 支持 反对

使用道具 举报

发表于 2009-9-4 10:49:39 | 显示全部楼层
呵呵,没见过这样用IF语句的,IF 语句里面不应该再含有IF 语句。。。
回复 支持 反对

使用道具 举报

发表于 2009-9-4 11:50:24 | 显示全部楼层
楼上的,IF的嵌套貌似可以吧。
原则上是不超过三个,不然影响可读性和代码质量。
回复 支持 反对

使用道具 举报

发表于 2009-9-4 15:18:28 | 显示全部楼层
貌似5个if,4个endif
不够数目啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-8-26 16:51 , Processed in 0.014577 second(s), 5 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表