收藏 分销(赏)

用VHDL设计键盘输入显示方案.doc

上传人:pc****0 文档编号:7823968 上传时间:2025-01-19 格式:DOC 页数:2 大小:33.50KB
下载 相关 举报
用VHDL设计键盘输入显示方案.doc_第1页
第1页 / 共2页
用VHDL设计键盘输入显示方案.doc_第2页
第2页 / 共2页
本文档共2页,全文阅读请下载到手机保存,查看更方便
资源描述
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 is Port (clk25MHz : in std_logic; Hcnt: in std_logic_vector(9 downto 0); -- horizontal counter Vcnt: in std_logic_vector(9 downto 0); -- verical counter romdatain : in std_logic_vector(7 downto 0); -- vvvvvvvvvvvvvvvvvvv outRed : out std_logic_vector(2 downto 0); -- final color outGreen: out std_logic_vector(2 downto 0); -- outputs outBlue : out std_logic_vector(1 downto 0); adrVideoMem : out std_logic_vector(3 downto 0)); -- addr in the Logo immage end DispCtrl; architecture Behavioral of DispCtrl is -- constants for Synchro module constant PAL:integer:=640; --Pixels/Active Line (pixels) constant LAF:integer:=480; --Lines/Active Frame (lines) -- constants for VGA Demo constant HBorder:integer:=40; -- Horizontal border (pixels) constant VBorder:integer:=40; -- Vertical border (lines) constant Hsize:integer:=7; -- Horizontal logo size (pixels) 标志的水平尺寸 64 constant Vsize:integer:=11; -- Vertical logo size (pixels) 标志的垂直尺寸 64 signal Horigin:integer:=60; -- Horizontal logo origin (pixels) 标志的水平原点 signal Vorigin:integer:=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 counter signal intHcnt: integer range 0 to 800-1; --PLD-1 - horizontal counter--- 水平计数器 signal intVcnt: integer range 0 to 521-1; -- LFD-1 - verical counter --- 垂直计数器 begin -- mapping the std_logic_vector ports to internal integers intHcnt <= conv_integer(Hcnt); intVcnt <= conv_integer(Vcnt); adrVideoPixel <= conv_std_logic_vector(intHcnt - Horigin,4); adrVideoLine <= conv_std_logic_vector(intVcnt - Vorigin,4); adrVideoMem <= adrVideoLine; -- counter for color bar dynamics diynamic:process (clk25MHz) begin if clk25MHz'event and clk25MHz = '1' then cntDyn <= cntDyn+1; end if; end process; mixer: process(clk25MHz,intHcnt, intVcnt) begin if intHcnt < PAL and intVcnt < LAF then -- 在激活的显示区域 if intHcnt >= Horigin and intHcnt <= Horigin + Hsize and intVcnt >= Vorigin and intVcnt <= Vorigin + Vsize then -- image --rom中的数据输出作为色差的信息; if romdatain(adrVideoPixel)='0' then outRed<="100"; outGreen<="100"; outBlue(1 downto 0) <="01"; else -- the moving lines area -- red outRed(2 downto 0) <="000"; -- green outGreen(2 downto 0) <="000"; -- blue outBlue(1 downto 0) <="00"; end if; else outRed <= (others => '0'); outGreen <= (others => '0'); outBlue <= (others => '0'); end if; end if; end process; -- place the logo at the mouse pos, if left button pressed end Behavioral; 2 、PS接口定义 见附件中Keyctrl.vhd和Ps2keyboard.vhd 3、状态灯指示字母输入 见附件中SnakeledDemo.vhd
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 百科休闲 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服