资源预览内容
第1页 / 共18页
第2页 / 共18页
第3页 / 共18页
第4页 / 共18页
第5页 / 共18页
第6页 / 共18页
第7页 / 共18页
第8页 / 共18页
第9页 / 共18页
第10页 / 共18页
亲,该文档总共18页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
EDA大作业实验报告基于 VHDL语言的 VGA显示与控制1111000079 田宇1111000081 王坤目录1 VGA显示原理 .31.1 VGA逐行扫描显示 .31.2 VGA时序分析 .32 时序部分的代码实现 .32.1 时序部分主要代码 .32.2 时序部分的实现 .42.2.1 行时序 .42.2.2 场时序 .53 控制部分的代码实现 .53.1 控制部分主要代码 .53.2 控制部分的实现 .123.2.1彩条与彩格 .123.2.2 字体显示 .124. 硬件平台实验 .121 VGA显示原理1.1 VGA逐行扫描显示逐行扫描是扫描从屏幕左上角一点开始,从左像右逐点扫描,每扫描完一行,电子束回到屏幕的左边下一行的起始位置,在这期间,CRT 对电子束进行消隐,每行结束时,用行同步信号进行同步;当扫描完所有的行,形成一帧,用场同步信号进行场同步,并使扫描回到屏幕左上方,同时进行场消隐,开始下一帧。1.2 VGA时序分析(图-1)2 时序部分的代码实现2.1 时序部分主要代码if ckevent and ck=1 then H15 and H=110 then Hs=160 and H11 and V=14 then Vs=45 and V525 then Ven=1;elsif V=525 then Ven=0;V=0;end if;end if;end if; 此部分代码为时序部分主要代码。2.2 时序部分的实现2.2.1 行时序 H: 行HS: 行消隐信号Hen: 允许显示由时序图(图-1)可以看出,行时序中需要有行消隐、行同步、显示前后沿等。其中有效显示信号为 640个周期。2.2.2 场时序与行时序相类似。3 控制部分的代码实现3.1 控制部分主要代码process(clk_d,sw)beginif clk_devent and clk_d=1 thenif sw=11 thensw_t=sw_t+1;end if;if sw=01 thensw_t=sw_t-1;end if;end if;end process;process(sw_t)beginif sw_t=0000 then R=Rd(s);G=Gd(s);B=Bd(s); elsif sw_t=0001 then R=Rd(s+1);G=Gd(s+1);B=Bd(s+1); elsif sw_t=0010 then R=Rd(s+2);G=Gd(s+2);B=Bd(s+2); elsif sw_t=0011 then R=Rd(s+3);G=Gd(s+3);B=Bd(s+3); if s=5 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);end if;elsif sw_t=0100 then R=Rd(s+4);G=Gd(s+4);B=Bd(s+4); if s=3 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(0);G=Gd(1);B=Bd(3);end if;elsif sw_t=0101 then R=Rd(s+5);G=Gd(s+5);B=Bd(s+5); if s=2 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(2);B=Bd(0);end if;elsif sw_t=0110 then R=Rd(s+6);G=Gd(s+6);B=Bd(s+6); if s=1 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(0);G=Gd(0);B=Bd(3);end if;elsif sw_t=0111 then R=Rd(s+7);G=Gd(s+7);B=Bd(s+7); if s=3 and t=5 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(0);G=Gd(0);B=Bd(0);end if;elsif sw_t=1000 then R=Rd(s+t)rem 8);G=Gd(s+t)rem 8);B=Bd(s+t)rem 8); elsif sw_t=1001 then R=Rd(s+t)rem 7);G=Gd(s+t)rem 7);B=Bd(s+t)rem 7); elsif sw_t=1010 then R=Rd(s+t)rem 6);G=Gd(s+t)rem 6);B=Bd(s+t)rem 6); elsif sw_t=1011 then R=Rd(s+t)rem 5);G=Gd(s+t)rem 5);B=Bd(s+t)rem 5); elsif sw_t=1100 then R=Rd(s+t)rem 4);G=Gd(s+t)rem 4);B=Bd(s+t)rem 4); elsif sw_t=1101 then R=Rd(s+t)rem 3);G=Gd(s+t)rem 3);B=Bd(s+t)rem 3); elsif sw_t=1110 then R=Rd(s+t)rem 2);G=Gd(s+t)rem 2);B=Bd(s+t)rem 2); elsif sw_t=1111 then R=Rd(s+t)rem 1);G=Gd(s+t)rem 1);B=Bd(s+t)rem 1); - if s=5 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;- if s=4 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;- if s=3 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;- if s=2 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;- if s=1 and t=4 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;- if s=3 and t=5 and (n=0 or m=0 or n=79 or m=59 or n=1 or m=1 or n=78 or m=58) then R=Rd(3);G=Gd(3);B=Bd(3);- end if;if s=1 and t=6 then R=Rd(3);G=Gd(3);B=Bd(3);end if;if s=2 and t=6 then R=Rd(3);G=Gd(3);B=Bd(3);end if;if s=3 and
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号