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

📄 rom_human_char.vhd

📁 这个是国外大学的项目代码
💻 VHD
字号:
------------------------------------------------------------------------
--  rom_human_char.vhd -- 
------------------------------------------------------------------------
--  Authors : Albert Zemba & Mihai Cucicea
------------------------------------------------------------------------
-- Software version: Xilinx ISE 7.1i 
--                   WebPack
------------------------------------------------------------------------
-- This source file contains the rom_human_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 the player by 16x16 pixels 
--(a happy face on vga)
------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

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

architecture Behavioral of rom_human_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_human_char (16x16)
-- Each element is a RGB colour that will be transmitted to vga
------------------------------------------------------------------------
constant mem : memorie :=
	(  ("000","000","000","000","000","000","001","001",
			"001","001","000","000","000","000","000","000"),
		("000","000","000","000","001","001","001","001",
			"001","001","001","001","000","000","000","000"),
		("000","000","000","001","001","001","000","000",
			"000","000","001","001","001","000","000","000"),
		("000","000","000","001","000","000","000","000",
			"000","000","000","000","001","000","000","000"),
		("000","001","001","000","000","110","110","000",
			"000","110","110","000","000","001","001","000"),
		("000","001","001","000","000","000","000","000",
			"000","000","000","000","000","001","001","000"),
		("001","001","000","000","000","000","000","000",
			"000","000","000","000","000","000","001","001"),
		("001","001","000","000","000","000","000","000",
			"000","000","000","000","000","000","001","001"),
	   ("001","001","000","000","000","000","000","000",
			"000","000","000","000","000","000","001","001"),
		("001","001","000","000","000","000","000","000",
			"000","000","000","000","000","000","001","001"),
		("000","001","001","000","110","110","000","000",
			"000","000","110","110","000","001","001","000"),
		("000","001","001","000","000","110","110","110",
			"110","110","110","000","000","001","001","000"),
		("000","000","000","001","000","000","000","110",
			"110","000","000","000","001","000","000","000"),
		("000","000","000","001","001","001","000","000",
			"000","000","001","001","001","000","000","000"),
		("000","000","000","000","001","001","001","001",
			"001","001","001","001","000","000","000","000"),
		("000","000","000","000","000","000","001","001",
			"001","001","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 + -