集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1339|回复: 2

求助:大家帮忙分析下代码逻辑上的问题,VHDL代码如下

[复制链接]
lwpj 发表于 2010-10-27 10:19:19 | 显示全部楼层 |阅读模式
附件的图片中就是出现逻辑问题的地方
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY test IS
        PORT(
                       
                        status0_rise          : IN  STD_LOGIC;
                        status1_rise        : IN  STD_LOGIC;
                        status2_rise    : IN  STD_LOGIC;
                        status3_rise          : IN  STD_LOGIC;
                        status4_rise        : IN  STD_LOGIC;
                        status5_rise    : IN  STD_LOGIC;
                        clkin           : IN  STD_LOGIC;
                        alcr            : IN  STD_LOGIC;
               
                        cnt_ctrl0       : BUFFER STD_LOGIC;
                        cnt_ctrl1       : BUFFER STD_LOGIC;
                        cnt_ctrl2       : BUFFER STD_LOGIC;
                        cnt_ctrl3       : BUFFER STD_LOGIC;
                        cnt_ctrl4       : BUFFER STD_LOGIC;
                        cnt_ctrl5       : BUFFER STD_LOGIC
                       
);
end test;


ARCHITECTURE rtl OF test IS
BEGIN
process(clkin,alcr)
BEGIN

if(alcr ='0') then
        cnt_ctrl0<='0';
        cnt_ctrl1<='0';
        cnt_ctrl2<='0';
        cnt_ctrl3<='0';
        cnt_ctrl4<='0';
        cnt_ctrl5<='0';
       
else
     if (clkin'event and clkin='1') then
        if(cnt_ctrl0 = '1' and status0_rise ='0')then
           cnt_ctrl0 <= '0';
        end if;
        if(cnt_ctrl1 = '1' and status1_rise ='0')then
           cnt_ctrl1 <= '0';
        end if;
        if(cnt_ctrl2 = '1' and status2_rise ='0')then
           cnt_ctrl2 <= '0';
        end if;
        if(cnt_ctrl3 = '1' and status3_rise ='0')then
           cnt_ctrl3 <= '0';
        end if;
        if(cnt_ctrl4 = '1' and status4_rise ='0')then
            cnt_ctrl4 <= '0';
        end if;
        if(cnt_ctrl5 = '1' and status5_rise ='0')then
            cnt_ctrl5 <= '0';
        end if;
        if (status0_rise ='1' and (cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' ))then
              cnt_ctrl0 <= '1';
        else
           if (status1_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' )) then
                cnt_ctrl1 <= '1';
           else
               if (status2_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl3='0' or cnt_ctrl4='0' or cnt_ctrl5='0' )) then
                   cnt_ctrl2 <= '1';
               else
                  if (status3_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl4='0' or cnt_ctrl5='0' ) )then
                     cnt_ctrl3 <= '1';
                  else
                     if (status4_rise ='1'and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl5='0' ))then
                        cnt_ctrl4 <= '1';
                     else
                        if (status5_rise ='1' and (cnt_ctrl0='0' or cnt_ctrl1='0' or cnt_ctrl2='0' or cnt_ctrl3='0' or cnt_ctrl4='0' ))then
                           cnt_ctrl5 <= '1';
                        end if;
                     end if;
                  end if;
                end if;
              end if;
           end if;
         end if;
end if;               
end process;


end rtl;

本帖子中包含更多资源

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

x
 楼主| lwpj 发表于 2010-10-27 15:37:59 | 显示全部楼层
谢谢大家的关注,问题已经解决!
Sunlife 发表于 2015-4-8 14:50:31 | 显示全部楼层
    怎么解决的
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

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

GMT+8, 2025-5-6 23:57 , Processed in 0.065089 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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