基于VHDL語言的VGA顯示與控制_第1頁
基于VHDL語言的VGA顯示與控制_第2頁
基于VHDL語言的VGA顯示與控制_第3頁
基于VHDL語言的VGA顯示與控制_第4頁
基于VHDL語言的VGA顯示與控制_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、EDA大作業(yè)實驗報告基于VHDL語言的VGA顯示與控制1111000079 田宇1111000081 王坤目錄1. VGA顯示原理31.1 VGA逐行掃描顯示31.2 VGAM序分析32. 時序部分的代碼實現(xiàn) 32.1 時序部分主要代碼 32.2 時序部分的實現(xiàn) 42.2.1 行時序 42.2.2 場時序 53. 控制部分的代碼實現(xiàn) 53.1 控制部分主要代碼 53.2 控制部分的實現(xiàn) 123.2.1 彩條與彩格 123.2.2 字體顯示 124. 硬件平臺實驗 121. VGA顯示原理1.1 VGA逐行掃描顯示逐行掃描是掃描從屏幕左上角一點開始,從左像右逐點掃描,每掃描完一行,電子束回到屏幕

2、的左邊下一行的起始位置,在這期間,CRT對電子束進行消隱,每行結(jié)束時,用行同步信號進行同步;當(dāng)掃描完所有的行,形成一幀,用場同步信號進行場同步, 并使掃描回到屏幕左上方,同時進行場消隱,開始下一幀。1.2 VGA時序分析VGA的ff時序(圖-1)2.時序部分的代碼實現(xiàn)2.1 時序部分主要代碼if ckevent and ck=1 then H15 and H110 the n Hs=110 then Hs=160and H800then Hen=1;elsif H=800 then Hen=0;H=0;end if;end if;end if;if Hsevent and Hs=1 then

3、V11 and V14 then Vs=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 時序部分的實現(xiàn)2.2.1 行時序H: 行HS: 行消隱信號Hen: 允許顯示由時序圖(圖 -1 )可以看出,行時序中需要有行消隱、行同步、顯示前后沿等。其中有效 顯示信號為 640 個周期。2.2.2 場時序與行時序相類似。3 控制部分的代碼實現(xiàn)3.1 控制部分主要代碼process(clk_d,sw)beginif clk_devent and clk_

4、d=1 then if sw=11 then sw_t=sw_t+1;end if;if sw=01 then sw_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 thenR=Rd(s+1);G=Gd(s+1);B=Bd(s+1);elsif sw_t=0010 thenR=Rd(s+2);G=Gd(s+2);B=Bd(s+2);elsif sw_t=0011 thenR=Rd(s+3);G=Gd(s+3);B=Bd

5、(s+3);if s=5 and t=4 and (n=0 or m=0 or n=79 or m=59 orn=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 thenR=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 orn=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 th

6、enR=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 orn=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 thenR=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 orn=1 or m=1 or n=78 or m=58) then R=Rd(0);G=Gd(0);B=Bd(3)

7、; end if;elsif sw_t=0111 thenR=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 orn=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)rem8);G=Gd(s+t)rem 8);B=Bd(s+t)rem 8);elsif sw_t=1001 then R=Rd(s+t)rem7);G=Gd(s+t)rem 7);B=Bd(s+

8、t)rem 7);elsif sw_t=1010 then R=Rd(s+t)rem6);G=Gd(s+t)rem 6);B=Bd(s+t)rem 6);elsif sw_t=1011 then R=Rd(s+t)rem5);G=Gd(s+t)rem 5);B=Bd(s+t)rem 5);elsif sw_t=1100 then R=Rd(s+t)rem4);G=Gd(s+t)rem 4);B=Bd(s+t)rem 4);elsif sw_t=1101 then R=Rd(s+t)rem3);G=Gd(s+t)rem 3);B=Bd(s+t)rem 3);elsif sw_t=1110 the

9、n R=Rd(s+t)rem2);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 o

10、r 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 a

11、nd 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;end if;if s=2 and t=6 then R=Rd(3);G=Gd(3);B=Bd(3); end if;if s=3 and t=6

12、then R=Rd(3);G=Gd(3);B=Bd(3); end if;if s=5 and t=6 thenif s=4 and t=6 then R=Rd(3);G=Gd(3);B=Bd(3); end if;R=Rd(3);G=Gd(3);B=Bd(3);end if;if s=3 and t=6 then R=Rd(3);G=Gd(3);B=Bd(3);end if;if s=3 and t=5 then R=Rd(3);G=Gd(3);B=Bd(3); end if;if s=3 and t=4 then R=Rd(3);G=Gd(3);B=Bd(3); end if;if s=3

13、 and t=3 then R=Rd(3);G=Gd(3);B=Bd(3); end if;if s=3 and t=2 then R=Rd(3);G=Gd(3);B=Bd(3); end if;end if;if s=2 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=3 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=4 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=5 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if

14、;if s=6 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=1 and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=2 and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=3 and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=4 and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if;end if;if s=1and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if

15、;if s=1and t=2thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=1and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=1and t=4thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=1and t=5thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=1and t=6thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=6 and t=1thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=6 and t=2thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=6 and t=3thenR=Rd(3);G=Gd(3);B=Bd(3);end if;if s=6 and t=5 then R=Rd(3);G=Gd(3);B=Bd(3); end if;if

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論