Forum Discussion
Altera_Forum
Honored Contributor
10 years agoi've got the same error for the operator "-". Using signed type and ieee.numeric_std. I would like to ask if my usage of "for" is correct.
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;