-------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 22:27:27 10/09/05 -- Design Name: -- Module Name: screenDecoder - Behavioral -- Project Name: -- Target Device: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity screenDecoder is Port ( clk : in std_logic; row : in std_logic_vector(8 downto 0); column : in std_logic_vector(9 downto 0); CharacterRow : out std_logic_vector(2 downto 0); CharacterColumn : out std_logic_vector(4 downto 0); TopRow : out std_logic_vector(8 downto 0); LeftColumn : out std_logic_vector(9 downto 0)); end screenDecoder; architecture Behavioral of screenDecoder is begin process(clk) begin if(clk = '1' and clk'event) then if(row < 61) then TopRow <= "000000000"; characterRow <= "000"; elsif(row > 60 and row < 131) then TopRow <= "001000110"; characterRow <= "001"; elsif(row > 130 and row < 201) then TopRow <= "010001100"; characterRow <= "010"; elsif(row > 200 and row < 271) then TopRow <= "011010010"; characterRow <= "011"; elsif(row > 270 and row < 341) then TopRow <= "100011000"; characterRow <= "100"; elsif(row > 340 and row < 411) then TopRow <= "101011110"; characterRow <= "101"; else TopRow <= "110100100"; characterRow <= "110"; end if; end if; end process; process(clk) begin if(clk = '1' and clk'event) then if(column < 31) then LeftColumn <= "0000000101"; CharacterColumn <= "00000"; elsif(column > 30 and column < 61) then LeftColumn <= "0000100011"; CharacterColumn <= "00001"; elsif(column > 60 and column < 91) then LeftColumn <= "0001000001"; CharacterColumn <= "00010"; elsif(column > 90 and column < 121) then LeftColumn <= "0001011111"; CharacterColumn <= "00011"; elsif(column > 120 and column < 151) then LeftColumn <= "0001111101"; CharacterColumn <= "00100"; elsif(column > 150 and column < 181) then LeftColumn <= "0010011011"; CharacterColumn <= "00101"; elsif(column > 180 and column < 211) then LeftColumn <= "0010111001"; CharacterColumn <= "00110"; elsif(column > 210 and column < 241) then LeftColumn <= "0011010111"; CharacterColumn <= "00111"; elsif(column > 240 and column < 271) then LeftColumn <= "0011110101"; CharacterColumn <= "01000"; elsif(column > 270 and column < 301) then LeftColumn <= "0100010011"; CharacterColumn <= "01001"; elsif(column > 300 and column < 331) then LeftColumn <= "0100110001"; CharacterColumn <= "01010"; elsif(column > 330 and column < 361) then LeftColumn <= "0101001111"; CharacterColumn <= "01011"; elsif(column > 360 and column < 391) then LeftColumn <= "0101101101"; CharacterColumn <= "01100"; elsif(column > 390 and column < 421) then LeftColumn <= "0110001011"; CharacterColumn <= "01101"; elsif(column > 420 and column < 451) then LeftColumn <= "0110101001"; CharacterColumn <= "01110"; elsif(column > 450 and column < 481) then LeftColumn <= "0111000111"; CharacterColumn <= "01111"; elsif(column > 480 and column < 511) then LeftColumn <= "0111100101"; CharacterColumn <= "10000"; elsif(column > 510 and column < 541) then LeftColumn <= "1000000011"; CharacterColumn <= "10001"; elsif(column > 540 and column < 571) then LeftColumn <= "1000100001"; CharacterColumn <= "10010"; elsif(column > 570 and column < 601) then LeftColumn <= "1000111111"; CharacterColumn <= "10011"; else --(column > 600 and column < 630) then LeftColumn <= "1001011101"; CharacterColumn <= "10100"; end if; end if; end process; end Behavioral;