搜索
bottom↓
回复: 2

这段程序怎么在 MAX+plus II 10.2编译不能通过 大侠们看看 急 在quartus里没

[复制链接]

出0入0汤圆

发表于 2010-7-14 14:47:18 | 显示全部楼层 |阅读模式
由于要换芯片atmel 的,必须用MAX+plus II,
可是现在编译不能通过   急


library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity count25 is
        port(
             Ain:in std_logic;
             Bin:in std_logic;
             Zin:in std_logic;
             Aout:buffer std_logic;
             Bout:buffer std_logic;
             Zout:buffer std_logic
             );
end count25;
architecture encoder_arc of count25 is   
        signal count11,count12:std_logic_vector(3 downto 0);
        signal clk11,clk12,clk1:std_logic;
        signal pclk1:std_logic;
        signal ba:std_logic;
        signal ck:std_logic;
        signal Counter:std_logic:='0';
        signal Zin_last:std_logic:='0';
        signal Zin_lastA:std_logic:='0';
        signal Zin_flag:std_logic:='0';
        signal C:std_logic;
begin
ck<=Ain xor Bin;
clk1<=clk11 or clk12;
process(Ain)
begin
        if(Ain'event and Ain='0') then
                if(Bin='0') then
                        ba<='1';
                else
                        ba<='0';
                end if;
        end if;
end process;
process(Bout,Aout,ba)
begin
--        if(ba='0') then
                C<=Bout;
--        elsif(ba='1') then
--                C<=Aout;
--        end if;
end process;
process(ck,count11,Zin)
begin
        if(ck'event and ck='1' and ck'last_value='0') then
                if(Zin_lastA='0' and Zin='0') then
                        Count11<="0000";
                        Zin_lastA<=not Zin;
                else
                        if(count11="0100")then
                                count11<="0000";
                        else
                                count11<=count11+1;
                        end if;       
                        Zin_lastA<=not Zin;
                end if;       
        end if;
end process;
process(ck)
begin
        if(ck'event and ck='0') then
                count12<=count11;
        end if;
end process;
process(count11,count12)
begin
        if(count11>="0010")then
                clk11<='0';
        else
                clk11<='1';
        end if;
        if(count12>="0010")then
                clk12<='0';
        else
                clk12<='1';
        end if;
end process;
process(count11,count12)
begin
        if(count11="0001" ) then
                pclk1<=Ain xnor  Bin;
        elsif(count11="0100") then
                pclk1<=Ain xor Bin;
    else pclk1<='0';
        end if;
end process;
process(ba,clk11,clk12,clk1,pclk1,Aout,Bout)
begin
        if(ba='0') then
                Aout<=clk1;
                if(pclk1'event and pclk1='1' and pclk1'last_value='0') then
                        if(clk1='0') then
                                Bout<='0';
                        else
                                Bout<='1';
                        end if;
                end if;               
        elsif(ba='1') then
                Bout<=clk1;
                if(pclk1'event and pclk1='1' and pclk1'last_value='0') then
                         if(clk1='0') then
                                Aout<='0';
                        else
                                Aout<='1';
                        end if;                       
                end if;
        end if;
end process;

process(Zin,C)
begin
        if(C'event and C='0' and C'last_value='1') then
                if((Zin_last XNOR Zin)='1') then
                        Zin_last<=(not Zin);
                        if(Zin='0') then
                                Counter<='1';
                        else       
                                Counter<='0';
                        end if;
                else
                        Counter<='0';
                end if;
        end if;
end process;
process(Counter, Aout)
begin
        if(Counter='1') then
                Zout<=Counter and Aout;       --'0'
        else
                Zout<='1';
        end if;
end process;
end encoder_arc;

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

发表于 2010-7-14 15:04:43 | 显示全部楼层
看得我甩脑壳。。。
这个代码做什么用的?哪行出错?什么错误代码?

出0入0汤圆

 楼主| 发表于 2010-7-14 15:11:37 | 显示全部楼层

(原文件名:222.jpg)


以上提示
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-6-13 19:08

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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