1、1、显示控制- Module Name: DispCtrl - Behavioral- Description: Generates the immage for the VGA Demo-library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity DispCtrl isPort (clk25MHz : in std_logic;Hcnt: in std_logic_vector(9 downto 0); - horizontal cou
2、nterVcnt: in std_logic_vector(9 downto 0); - verical counterromdatain : in std_logic_vector(7 downto 0); - vvvvvvvvvvvvvvvvvvvoutRed : out std_logic_vector(2 downto 0); - final coloroutGreen: out std_logic_vector(2 downto 0); - outputsoutBlue : out std_logic_vector(1 downto 0);adrVideoMem : out std_
3、logic_vector(3 downto 0); - addr in the Logo immageend DispCtrl;architecture Behavioral of DispCtrl is- constants for Synchro moduleconstant PAL:integer:=640; -Pixels/Active Line (pixels)constant LAF:integer:=480; -Lines/Active Frame (lines)- constants for VGA Democonstant HBorder:integer:=40; - Hor
4、izontal border (pixels)constant VBorder:integer:=40; - Vertical border (lines)constant Hsize:integer:=7; - Horizontal logo size (pixels) 标志的水平尺寸 64constant Vsize:integer:=11; - Vertical logo size (pixels) 标志的垂直尺寸 64signal Horigin:integer:=60; - Horizontal logo origin (pixels) 标志的水平原点signal Vorigin:i
5、nteger:=60; - Vertical logo origin (pixels) 标志的垂直原点signal adrVideoPixel: std_logic_vector(2 downto 0);signal adrVideoLine: std_logic_vector(3 downto 0);signal cntDyn: integer range 0 to 2*28-1; - dynamic effect countersignal intHcnt: integer range 0 to 800-1; -PLD-1 - horizontal counter- 水平计数器signal
6、 intVcnt: integer range 0 to 521-1; - LFD-1 - verical counter - 垂直计数器begin- mapping the std_logic_vector ports to internal integersintHcnt = Horigin and intHcnt = Vorigin and intVcnt 0); outGreen 0); outBlue 0); end if; end if; end process;- place the logo at the mouse pos, if left button pressedend Behavioral;2 、PS 接口定义见附件中 Keyctrl.vhd 和 Ps2keyboard.vhd3、状态灯指示字母输入见附件中 SnakeledDemo.vhd