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

📄 rom_wall_char.vhd

📁 这个是国外大学的项目代码
💻 VHD
字号:
------------------------------------------------------------------------
--  rom_wall_char.vhd -- 
------------------------------------------------------------------------
--  Authors : Albert Zemba & Mihai Cucicea
------------------------------------------------------------------------
-- Software version: Xilinx ISE 7.1i 
--                   WebPack
------------------------------------------------------------------------
-- This source file contains the rom_wall_char component
------------------------------------------------------------------------
--  Behavioral description
--  It works like a matrix with the indexes line and col 
--  The selected element represents the RGB colour
-- The matrix represents an impossible position of 
--  the player on vga formed by 16x16 pixels (a brick wall on vga)
------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity rom_wall_char is
	port(line, col : in std_logic_vector(3 downto 0); 
			color : out std_logic_vector(2 downto 0)
	);
end rom_wall_char;

architecture Behavioral of rom_wall_char is

type matrice is array(0 to 15) of std_logic_vector(2 downto 0);
type memorie is array (0 to 15) of matrice; 
------------------------------------------------------------------------
-- The memory matrix of rom_wall_char (16x16)
-- Each element is a RGB colour that will be transmitted to vga
------------------------------------------------------------------------
constant mem : memorie :=
	(  ("000","000","000","000","000","000","000","000",
			"000","000","000","000","000","000","000","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","100","100","100","100","100","100","100",
			"100","100","100","100","100","100","100","000"),
		("000","000","000","000","000","000","000","000",
			"000","000","000","000","000","000","000","000"),
	   ("000","000","000","000","000","000","000","000",
			"000","000","000","000","000","000","000","000"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("100","100","100","100","100","100","100","000",
			"000","100","100","100","100","100","100","100"),
		("000","000","000","000","000","000","000","000",
			"000","000","000","000","000","000","000","000")
	);
 
begin
	color <= mem(conv_integer(line))(conv_integer(col)); 

end Behavioral;

⌨️ 快捷键说明

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