Čeština / English
Login

SVN Repository / Prohlížení

Aktuální adresář: FITkit / trunk / apps / games / pexeso / fpga /

char_rom.vhd

   1  -- IVH project, Vojtech Mrazek, xmraze06
   2  -- Vraci dekodovani znaku 8x16 podle vstupu
   3  --
   4  library IEEE;
   5  use IEEE.std_logic_1164.ALL;
   6  use ieee.std_logic_arith.all;
   7  use ieee.std_logic_unsigned.all;
   8  
   9  entity char_rom is
  10  	Generic (
  11  		SIZE : integer := 4
  12  	);
  13  	Port (
  14  		ADDRESS : in std_logic_vector(SIZE-1 downto 0);
  15  		ROW : in std_logic_vector(3 downto 0);
  16  		COLUMN : in std_logic_vector(2 downto 0);
  17  		DATA : out std_logic
  18  	);
  19  end char_rom;
  20  
  21  architecture behv of char_rom is
  22  	type t_mem is array (0 to (2**SIZE)-1) of std_logic_vector(0 to 127);
  23  	constant rommem : t_mem :=(
  24  --znak  => "   1   |   2   |   3   |   4   |   5   |   6   |   7   |   8   |   9   |  10   |   11  |   12  |  13   |   14  |   15  |   16  |)
  25  		 0 => "00000000000000000000000000000000000000000001110000100010001000100010001000100010001000100001110000000000000000000000000000000000", -- 0
  26  		 1 => "00000000000000000000000000000000000000000011111000001000000010000000100000001000000010000000110000000000000000000000000000000000", -- 1
  27  		 2 => "00000000000000000000000000000000000000000011111000000010000001000000100000010000001000100001110000000000000000000000000000000000", -- 2
  28  		 3 => "00000000000000000000000000000000000000000001110000100010001000000001100000100000001000100001110000000000000000000000000000000000", -- 3
  29  		 4 => "00000000000000000000000000000000000000000011100000010000001111100001001000010100000110000001000000000000000000000000000000000000", -- 4
  30  		 5 => "00000000000000000000000000000000000000000001110000100010001000000001110000000100000001000011110000000000000000000000000000000000", -- 5
  31  		 6 => "00000000000000000000000000000000000000000001110000100010001000100001111000000010000001000011100000000000000000000000000000000000", -- 6
  32  		 7 => "00000000000000000000000000000000000000000000100000001000000100000001000000100000001000100011111000000000000000000000000000000000", -- 7
  33  		 8 => "00000000000000000000000000000000000000000001110000100010001000100001110000100010001000100001110000000000000000000000000000000000", -- 8
  34  		 9 => "00000000000000000000000000000000000000000000111000010000001000000011110000100010001000100001110000000000000000000000000000000000", -- 9
  35  		--10 => "00000000000000000000000000000000000000000111011100100010000111000001010000010100000010000000110000000000000000000000000000000000", -- A
  36  	 	--11 => "00000000000000000000000000000000000000000001111100100010001000100001111000100010001000100001111100000000000000000000000000000000", -- B
  37  		--12 => "00000000000000000000000000000000000000000001110000100010000000100000001000000010001000100011110000000000000000000000000000000000", -- C
  38  		--13 => "00000000000000000000000000000000000000000000111100010010001000100010001000100010000100100000111100000000000000000000000000000000", -- D
  39  		--14 => "00000000000000000000000000000000000000000011111000100100000101000001110000010100001001000011111000000000000000000000000000000000", -- E
  40  		--15 => "00000000000000000000000000000000000000000000111000000100000101000001110000010100001001000011111000000000000000000000000000000000", -- F
  41  
  42  		 others => (others=>'-') -- others don't care
  43  		);
  44  
  45  begin
  46  	vyhodnoceni: process (ADDRESS, ROW, COLUMN) is
  47     	variable var_data : std_logic_vector(127 downto 0);
  48  	begin
  49  		var_data := rommem(conv_integer(ADDRESS));
  50  		data <= var_data(conv_integer(ROW & COLUMN));
  51  
  52  	end process vyhodnoceni;
  53  
  54  end behv;
  55  
Zobrazeno: 665614x Naposledy: 23.5.2022 00:58:36