【发布时间】:2015-09-25 12:12:06
【问题描述】:
我遇到了运算符“-”的错误。使用有符号类型和 ieee.numeric_std。我想问一下我对“for”的用法是否正确。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_signed.ALL;
use IEEE.STD_LOGIC_TEXTIO.ALL;
use ieee.numeric_std.all;
entity stage_1 is
Port (
clk : in bit;
imagem: in SIGNED (19999 DOWNTO 0);
imagemanterior: in SIGNED (19999 DOWNTO 0);
Ix: out SIGNED (24999 DOWNTO 0);
Iy: out SIGNED (24999 DOWNTO 0);
It: out SIGNED (24999 DOWNTO 0)
);
end stage_1;
architecture Behavioral of stage_1 is
begin
process (clk)
begin
If (clk 'event and clk = '1') then
for I in 0 to 2448 loop
Ix(I*10+9 DOWNTO I*10) <= 1/4 * (imagemanterior((I+1)*8+7 DOWNTO (I+1)*8) - imagemanterior(I*8+7 DOWNTO I*8) + imagemanterior ((I+1)*8+407 DOWNTO
(I+1)*8+400) - imagemanterior(I*8+407 DOWNTO I*8+400) + imagem((I+1)*8+7 DOWNTO(I+1)*8) - imagem(I*8+7 DOWNTO I*8)+ imagem((I+1)*8+407 DOWNTO(I+1)*8) - imagem((I)*8+407 DOWNTO I*8 +400));
Iy(I*10+9 DOWNTO I*10) <= 1/4*(imagemanterior((I*8)+407 DOWNTO (I)*8+400) - imagemanterior(I*8+7 DOWNTO I*8) + imagemanterior((I+1)*8+407 DOWNTO (I+1)*8) - imagemanterior((I+1)*8+7 DOWNTO(I+1)*8) + imagem(I*8+407 DOWNTO I*8+400) - imagem(I*8+7 DOWNTO I*68) + imagem((I+1)*8+407 DOWNTO (I+1)*8+400) -imagem((I+1)*8+7 DOWNTO(I+1)*8));
It(I*10+9 DOWNTO I*10) <= 1/4 * (imagem(I*8+7 DOWNTO I*8)- imagemanterior((I*8+7)-I*8) + imagem((I*8)+407 DOWNTO I*8+400)- imagemanterior(I*8+407 DOWNTO I*8+400) +imagem((I+1)*8+7 DOWNTO(I+1)*8)- imagemanterior((I+1)*8+7 DOWNTO(I+1)*8) + imagem((I+1)*8+407 DOWNTO (I+1)*8+400)- imagemanterior((I+1)*8+407 DOWNTO (I+1)*8+400));
end loop;
end if ;
end process;
end Behavioral;
【问题讨论】:
-
格式化您的问题:从文本中删除垃圾并从代码中删除空行。
-
这是一个有用的资源:www.sscce.org
-
删除
std_logic_signed如果-的两个定义适合,编译器无法知道您的意思,所以在您消除歧义之前,两者都被重新定义为“隐藏”。 -
尝试删除 IEEE.STD_LOGIC_1164.ALL 和 IEEE.STD_LOGIC_signed.ALL。我仍然遇到同样的错误。
-
奇怪的是,我只在 It 行中得到错误,而且它在该行的第一个“-”中。
标签: vhdl operator-keyword definition