-------------------------------------- -- Creació d'una creu en un monitor -- -- Creat per: Lluís Magí 2000 -- -------------------------------------- LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; ENTITY creu IS PORT( imatge_in : in std_logic_vector(23 downto 0); posicio_x : in integer range 0 to (2**11)-1; posicio_y : in integer range 0 to (2**10)-1; x_act : in integer range 0 to (2**11)-1; y_act : in integer range 0 to (2**10)-1; activar : in std_logic; clk_pixel : in std_logic; imatge_out : out std_logic_vector(23 downto 0); valor_rgb : out std_logic_vector(23 downto 0) ); constant CREU : integer := 10; END creu; ARCHITECTURE arqui_creu OF creu IS signal posicio_x_menys, posicio_x_mes : integer range 0 to (2**10); signal posicio_y_menys, posicio_y_mes : integer range 0 to (2**9); BEGIN PROCESS(clk_pixel) BEGIN if rising_edge(clk_pixel) then case activar is when '1' => if x_act = posicio_x and y_act = posicio_y then valor_rgb <= imatge_in; elsif ((x_act=posicio_x) and (y_act > posicio_y_menys and y_act < posicio_y_mes)) OR ((y_act=posicio_y) and (x_act > posicio_x_menys and x_act < posicio_x_mes)) then imatge_out(23 downto 0) <= "111111111111111111111111"; else imatge_out <= imatge_in; end if; when others => imatge_out <= imatge_in; end case; end if; end process; process(clk_pixel) begin if falling_edge(clk_pixel) then posicio_x_menys<=posicio_x-CREU; posicio_x_mes<=posicio_x+CREU; posicio_y_menys<=posicio_y-CREU; posicio_y_mes<=posicio_y+CREU; end if; end process; end arqui_creu;