⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rom2_labirint.vhd

📁 游戏玩家通过控制PS/2键盘上的方向键
💻 VHD
字号:
--------------------------------------------------------------------------------
-- Company: 
-- Engineer:
--
-- Create Date:    08:55:36 05/09/09
-- Design Name:    
-- Module Name:    rom2_labirint - 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;

entity rom2_labirint is
	port(row, col : in std_logic_vector(5 downto 0);
			char : out std_logic_vector(2 downto 0)
	);
end rom2_labirint;

architecture Behavioral of rom2_labirint is

type matrice is array(0 to 39) of std_logic_vector(2 downto 0);
type memorie is array (0 to 29) of matrice; 
constant mem : memorie :=
	(  ("001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001"),    

		("001","000","000","000","001","000","000","000","001","000",
			"000","000","001","000","000","000","001","000","000","000",
			"001","000","000","000","000","000","000","000","000","001",
			"000","000","000","000","000","001","001","001","001","001"),

		("001","001","001","000","001","000","001","000","001","000",
			"001","000","001","000","001","000","001","000","001","000",
			"000","000","000","001","000","000","000","000","001","001",
			"000","000","000","001","000","001","001","001","001","001"),

		("001","000","000","000","000","000","001","000","001","000",
			"001","000","001","000","001","000","001","000","001","000",
			"000","000","000","000","001","001","000","000","000","000",
			"001","000","000","000","000","001","001","001","001","001"),

		("001","000","000","000","000","000","001","000","000","000",
			"001","000","000","000","001","000","000","000","001","001",
			"001","000","000","000","000","000","000","001","000","001",
			"000","000","001","000","000","001","001","001","001","001"),

		("001","001","000","000","001","001","001","001","001","000",
			"001","001","001","001","001","001","001","001","001","000",
			"000","000","001","001","000","000","000","000","000","000",
			"000","000","001","000","000","001","001","001","001","001"),
		
		("001","001","000","000","000","000","000","000","000","000",
			"000","000","000","000","000","001","000","000","001","000",
			"001","000","000","000","000","001","000","001","001","000",
			"000","001","000","001","001","001","001","001","001","001"),

		("001","001","000","001","001","001","001","001","000","001",
			"001","001","001","001","001","001","001","000","001","000",
			"000","000","000","001","000","001","000","000","000","001",
			"000","000","000","000","000","001","000","001","000","001"),

		("001","001","000","000","001","000","001","000","000","000",
			"000","000","000","001","000","000","000","000","001","000",
			"001","000","000","000","000","000","000","000","001","000",
			"000","001","000","001","000","001","001","001","000","001"),

		("001","000","000","000","001","000","001","000","000","000",
			"001","000","000","000","000","001","000","001","001","000",
			"001","000","001","000","001","000","000","000","000","001",
			"000","000","000","001","000","001","000","000","000","001"),

		("001","000","000","001","000","000","000","000","001","000",
			"000","001","000","000","001","001","000","000","001","000",
			"001","000","000","000","001","001","000","001","000","001",
			"000","000","000","001","000","000","000","000","001","001"),

		("001","000","000","000","000","000","001","001","000","001",
			"000","001","001","000","000","001","000","000","000","000",
			"000","001","000","001","001","001","000","001","000","000",
			"000","000","000","001","001","001","001","000","000","001"),

		("001","000","001","001","000","000","000","001","000","000",
			"001","001","000","000","000","001","000","001","001","001",
			"001","001","000","001","000","000","000","000","001","001",
			"000","001","001","000","000","000","000","000","000","001"),

		("001","000","000","000","001","000","000","001","000","001",
			"001","000","000","000","001","000","000","000","001","000",
			"000","000","000","001","001","001","001","000","001","000",
			"000","001","000","000","001","000","000","000","001","001"),

		("001","000","000","000","000","000","000","000","000","000",
			"000","001","000","000","000","001","001","001","000","000",
			"000","000","000","000","000","001","000","001","001","001",
			"000","001","000","001","000","000","000","000","000","001"),

		("001","001","001","001","000","001","000","001","001","000",
			"001","001","001","001","001","001","000","000","001","000",
			"000","000","000","000","001","000","001","000","001","000",
			"001","001","001","001","001","000","001","000","000","001"),

		("001","000","000","000","000","000","000","000","000","001",
			"000","000","000","001","000","000","000","000","000","000",
			"000","000","000","000","000","000","000","000","001","000",
			"000","000","000","000","001","000","000","001","001","001"),

		("001","000","000","001","001","001","000","001","001","001",
			"000","001","000","001","001","001","001","001","001","001",
			"001","000","001","000","000","001","000","001","000","001",
			"001","000","001","000","001","000","001","000","000","001"),

		("001","000","000","000","000","000","000","000","000","000",
			"001","000","000","000","000","001","000","000","000","000",
			"000","000","000","000","000","000","000","000","000","000",
			"001","000","001","000","001","000","000","001","000","001"),

   	("001","000","001","001","000","001","001","001","001","001",
			"000","001","000","000","000","001","001","000","000","000",
			"001","000","000","000","000","000","001","000","000","000",
			"001","000","000","000","001","000","000","001","000","001"),

		("001","000","001","001","001","000","000","000","001","000",
			"000","000","000","000","001","000","000","000","000","000",
			"000","000","000","000","000","000","000","001","000","000",
			"000","001","001","001","001","000","000","000","000","001"),

		("001","000","000","000","001","000","000","000","000","000",
			"000","000","001","001","001","001","001","001","001","000",
			"000","000","000","001","000","000","000","000","001","001",
			"001","000","000","001","001","000","001","000","001","001"),

		("001","001","000","000","001","000","001","000","000","001",
			"000","000","001","001","000","000","000","000","001","001",
			"000","001","000","000","001","000","001","000","000","000",
			"000","000","000","000","000","000","000","000","000","001"),

		("001","000","000","000","000","000","000","000","000","000",
			"000","001","001","000","000","001","001","000","000","001",
			"001","000","001","001","000","000","000","001","000","000",
			"001","001","001","001","001","000","000","000","000","001"),

		("001","000","001","000","001","000","000","001","001","001",
			"000","001","000","000","001","001","001","001","000","000",
			"000","001","000","000","000","000","000","000","001","001",
			"000","000","000","000","001","000","001","000","000","001"),

		("001","000","001","001","001","000","000","000","000","001",
			"000","000","000","001","001","000","000","001","001","001",
			"000","001","000","001","001","000","001","000","000","001",
			"000","000","000","000","000","000","001","001","000","001"),

		("001","000","000","000","001","001","000","001","000","000",
			"000","001","001","001","001","000","000","001","000","000",
			"000","000","000","001","000","000","000","001","001","000",
			"000","000","000","001","000","001","000","000","000","001"),

		("001","000","000","000","000","000","000","000","000","000",
			"001","000","000","000","000","000","000","001","000","000",
			"000","001","000","000","001","000","000","000","000","000",
			"001","000","000","000","001","000","000","000","000","001"),

		("001","001","001","001","001","001","001","001","000","000",
			"000","000","000","000","000","001","000","000","000","000",
			"000","000","000","000","000","001","000","001","000","000",
			"000","000","000","000","000","000","000","000","010","001"),

		("001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001",
			"001","001","001","001","001","001","001","001","001","001")
	);
 
begin
	char <= mem(conv_integer(row))(conv_integer(col)); 

end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -