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

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2774|回复: 1

求助,编译报错

[复制链接]
发表于 2004-7-22 18:07:41 | 显示全部楼层 |阅读模式

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

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

x
编译报错如下:
sum of the widths of these concatenate operands is not equal to the width of the result
请问是何原因?
谢谢
源程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity a1 is
port(clk  : in std_logic;
      n  : in std_logic;
      x    : in std_logic_vector(11 downto 0);
      y1   : out std_logic_vector(11 downto 0);      
      y2   : out std_logic_vector(11 downto 0));
end a1;
architecture dd1 of a1 is
signal p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12:std_logic_vector(11 downto 0);
begin
a: process(n)
  variable s: integer range 0 to 14;
  begin
   if (n'event and n='1') then
    case s is
      when 0=>
        p0<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 1=>
        p1<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 2=>
        p2<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 3=>
        p3<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 4=>
        p4<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 5=>
        p5<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 6=>
        p6<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 7=>
        p7<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 8=>
        p8<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 9=>
        p9<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 10=>
        p10<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 11=>
        p11<=not x(11)&x(10 downto 0);
        s:=s+1;
      when 12=>
        p12<=not x(11)&x(10 downto 0);
        s:=s+1;
      when others =>
        null;
    end case;
   end if;
end process a;
b1:process(clk)
  variable q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12:std_logic_vector(11 downto 0);
  variable ta1,ta2,ta22,ta3,tb1,tb2,tb22,tb3,ya,yb:std_logic_vector(11 downto 0);
  begin
   if (clk'event and clk='1') then
q0:=p0;
q1:=p1;
q2:=p2;
q3:=p3;
q4:=p4;
q5:=p5;
q6:=p6;
q7:=p7;
q8:=p8;
q9:=p9;
q10:=p10;
q11:=p11;
q12:=p12;
ta1:=q0+q12;
ta1:=ta1-q6;
ta2:=q1+q11;
ta2:=ta2-q5;
ta2:=ta2-q7;
ta22:=ta2(11)&ta2(11 downto 1);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11 downto 2);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11 downto 4);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11 downto 5);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11 downto 6);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11 downto 8);
ta22:=ta22+ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11)&ta2(11 downto 9);
ta3:=q2+q10;
ta3:=ta3-q4;
ta3:=ta3-q8;
ta3:=ta3(11)&ta3(11 downto 1);
ya:=ta1+ta22;
ya:=ya+ta3;
y1<=ya;
tb1:=q1+q5;
tb1:=tb1-q7;
tb1:=tb1-q11;
tb1:=tb1(11)&tb1(11 downto 1);
tb2:=q2+q4;
tb2:=tb2-q8;
tb2:=tb2-q10;
tb22:=tb2(11)&tb2(11 downto 1);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11 downto 2);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11 downto 4);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11 downto 5);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11 downto 6);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11 downto 8);
tb22:=tb22+tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11)&tb2(11 downto 9);
tb3:=q3-q9;
yb:=tb1+tb22;
yb:=yb+tb3;
y2<=yb;
end if;
end process b1;
end dd1;
发表于 2004-7-24 10:35:13 | 显示全部楼层

求助,编译报错

前边是一位的,后边是12位的,可以按位相与么??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2025-5-14 00:40 , Processed in 0.019628 second(s), 11 queries , Gzip On, MemCached On.

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