Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- The problem you are having is not in the code in the first post - that code compiles fine (with some length missmatch warnings). Please post the code you are working with now as it is clearly not the code in the first post. --- Quote End --- the code is this: 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; --package image_array_2 is -- type image_array is array(0 to 49, 0 to 49) of unsigned(7 downto 0); --type image_derivadas is array(0 to 49, 0 to 49) of unsigned (8 downto 0); --end package image_array_2; use work.imagens.all; entity stage_1 is Port ( clk : in bit; imagem: in image_array; imagemanterior: in image_array; Ix: out image_derivadas; Iy: out image_derivadas; It: out image_derivadas ); end stage_1; architecture Behavioral of stage_1 is begin process (clk) begin If (clk 'event and clk = '1') then for x in imagem'range(1) loop for y in imagem'range(2) loop Ix(x,y) <= ((imagemanterior(x,y+1) - imagemanterior(x,y) + imagemanterior (x+1,y+1) - imagemanterior(x+1,y) + imagem(x,y+1) - imagem(x,y)+imagem(x+1,y+1)-imagem(x,y+1)))/4; Iy(x,y) <= ((imagemanterior(x+1,y) - imagemanterior(x,y) + imagemanterior(x+1,y+1) - imagemanterior(x,y+1) + imagem(x+1,y) - imagem(x,y) + imagem(x+1,y+1) -imagem(x,y+1)))/4; It(x,y) <= (imagem(x,y) - imagemanterior(x,y) + imagem(x+1,y)- imagemanterior(x+1,y) +imagem(x,y+1)- imagemanterior(x,y+1) + imagem(x+1,y+1)- imagemanterior(x+1,y+1))/4; end loop; end loop; end if ; end process; end Behavioral;