北郵數(shù)電實(shí)驗(yàn)雙色點(diǎn)陣掃描顯示控制器_第1頁
北郵數(shù)電實(shí)驗(yàn)雙色點(diǎn)陣掃描顯示控制器_第2頁
北郵數(shù)電實(shí)驗(yàn)雙色點(diǎn)陣掃描顯示控制器_第3頁
北郵數(shù)電實(shí)驗(yàn)雙色點(diǎn)陣掃描顯示控制器_第4頁
北郵數(shù)電實(shí)驗(yàn)雙色點(diǎn)陣掃描顯示控制器_第5頁
已閱讀5頁,還剩9頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

北京郵電大學(xué)數(shù)字電路與邏輯設(shè)計(jì)實(shí)驗(yàn)報(bào)告(實(shí)驗(yàn)5)學(xué)院:電子工程學(xué)院專業(yè):電子信息科學(xué)與技術(shù)

實(shí)驗(yàn)5雙色點(diǎn)陣掃描顯示控制器一、實(shí)驗(yàn)要求1.用8×8點(diǎn)陣顯示字符,每次顯示一個(gè)字符,每秒切換一次,顯示內(nèi)容為“B”、“U”、“P”、“T”及姓名的第一個(gè)字母。如張三顯示的內(nèi)容為“B”、“U”、“P”、“T”、“Z”、“S”。2.為系統(tǒng)設(shè)置一個(gè)復(fù)位鍵,復(fù)位后重新從“B”開始循環(huán)顯示。要求使用按鍵復(fù)位。二、實(shí)驗(yàn)設(shè)計(jì)思路我們知道點(diǎn)陣的結(jié)構(gòu),當(dāng)row輪流出0的時(shí)候,二極管陰極為低電平,這時(shí)候我們給到一個(gè)高電平在紅燈或者綠燈的陽極的時(shí)候,就能驅(qū)使燈點(diǎn)亮。這樣我們可以基于“視覺暫留”的現(xiàn)象,快速刷新row燈,使得點(diǎn)陣能夠快速點(diǎn)亮,這樣就能顯示一個(gè)完整的字,最后再利用一個(gè)模7計(jì)數(shù)器來實(shí)現(xiàn)每個(gè)字母之間的轉(zhuǎn)換。我們引入一個(gè)1000hz的時(shí)鐘,并對其進(jìn)行一個(gè)1000分頻變成1hz的時(shí)鐘。之后再利用這個(gè)模7計(jì)數(shù)器來控制cor_l和cor_g和row來控制燈的顏色、每行燈亮?xí)r列的亮燈情況。另外,我們需要一個(gè)模8計(jì)數(shù)器,后面再設(shè)計(jì)一個(gè)3-8線譯碼器,這樣能夠控制row的亮燈情況。最后我們需要注意的是,由于row需要快速刷新,故我們需要用1000hz的時(shí)鐘,而字符之間的轉(zhuǎn)換的計(jì)數(shù)器要用1hz的時(shí)鐘,來滿足亮燈1s的條件。我們還需要設(shè)計(jì)一個(gè)復(fù)位鍵,以便能做到按下按鈕重新回到第一個(gè)字母的功能,這需要reset按下時(shí),模7計(jì)數(shù)器的數(shù)字回到0。這樣把帶防抖的復(fù)位鍵加進(jìn)去即可。最后頂層將這兩個(gè)模塊連接起來即可。三、VHDL代碼及注釋點(diǎn)陣部分:libraryIEEE;useIEEE.std_logic_1164.all;useIEEE.std_logic_unsigned.all;useIEEE.std_logic_arith.all;entitydianzhenisport(clk:instd_logic;col_r:outstd_logic_vector(7downto0);--紅燈的控制顯示col_g:outstd_logic_vector(7downto0);--綠燈的控制顯示row:outstd_logic_vector(7downto0);--二極管陰極控制reset:instd_logic);enddianzhen;architectureaofdianzhenissignalsel7:std_logic_vector(2downto0);--模7計(jì)數(shù)器的信號signalsel8:std_logic_vector(2downto0);--模8計(jì)數(shù)器的信號signalclk_add:std_logic:='0';--分頻后的時(shí)鐘beginp1:process(clk)--1000分頻variablec:integerrange0to499:=0;beginif(clk'eventandclk='1')thenifc=499thenclk_add<=notclk_add;c:=0;elsec:=c+1;endif;endif;endprocessp1;p2:process(clk)--模8計(jì)數(shù)器beginif(clk'eventandclk='1')thensel8<=sel8+1;--加滿自動(dòng)重新歸零endif;endprocessp2;p3:process(clk_add,reset)--模7計(jì)數(shù)器beginif(reset='1')then--當(dāng)出現(xiàn)重置的信號為高電平時(shí),計(jì)數(shù)器重置為000,這樣就能回到字母Bsel7<="000";elsif(CLK_add'EVENTANDCLK_add='1')thenif(sel7=O"6")thensel7<=O"0";--模滿7歸零elsesel7<=sel7+1;endif;endif;endprocessp3;p4:process(sel7,sel8)—模7和模8共同作用,模8用來快速刷新row,模7用來控制哪個(gè)字母,每行對應(yīng)相對的列點(diǎn)亮的情況,顯示字母。begincasesel7iswhenO"0"=>casesel8is--字母B,運(yùn)用循環(huán)嵌套,如7是顯示B的最上面一行,0是顯示最下面一行左下角燈為(0,0),右上角為(7,7),這樣的方式點(diǎn)亮燈顯示字符。whenO"7"=>col_r<="00111110";col_g<="00000000";row<="01111111"whenO"6"=>col_r<="01000110";col_g<="00000000";row<="10111111";whenO"5"=>col_r<="01000110";col_g<="00000000";row<="11011111";whenO"4"=>col_r<="00111110";col_g<="00000000";row<="11101111";whenO"3"=>col_r<="01000110";col_g<="00000000";row<="11110111";whenO"2"=>col_r<="01000110";col_g<="00000000";row<="11111011";whenO"1"=>col_r<="01000110";col_g<="00000000";row<="11111101";whenO"0"=>col_r<="00111110";col_g<="00000000";row<="11111110";whenOTHERS=>col_r<="00111110";col_g<="00000000";row<="11111110";endcase;whenO"1"=>casesel8is--字母UwhenO"7"=>col_r<="00000000";col_g<="11000110";row<="01111111";whenO"6"=>col_r<="00000000";col_g<="11000110";row<="10111111";whenO"5"=>col_r<="00000000";col_g<="11000110";row<="11011111";whenO"4"=>col_r<="00000000";col_g<="11000110";row<="11101111";whenO"3"=>col_r<="00000000";col_g<="11000110";row<="11110111";whenO"2"=>col_r<="00000000";col_g<="11000110";row<="11111011";whenO"1"=>col_r<="00000000";col_g<="11111110";row<="11111101";whenO"0"=>col_r<="00000000";col_g<="01111100";row<="11111110";whenOTHERS=>col_r<="00000000";col_g<="01111100";row<="11111110";endcase;whenO"2"=>casesel8is--字母PwhenO"7"=>col_r<="00111110";col_g<="00000000";row<="01111111";whenO"6"=>col_r<="01000110";col_g<="00000000";row<="10111111";whenO"5"=>col_r<="01000110";col_g<="00000000";row<="11011111";whenO"4"=>col_r<="01000110";col_g<="00000000";row<="11101111";whenO"3"=>col_r<="00111110";col_g<="00000000";row<="11110111";whenO"2"=>col_r<="00000110";col_g<="00000000";row<="11111011";whenO"1"=>col_r<="00000110";col_g<="00000000";row<="11111101";whenO"0"=>col_r<="00000110";col_g<="00000000";row<="11111110";whenOTHERS=>col_r<="00000110";col_g<="00000000";row<="11111110";endcase;whenO"3"=>casesel8is--字母TwhenO"7"=>col_r<="00000000";col_g<="11111111";row<="01111111";whenO"6"=>col_r<="00000000";col_g<="11111111";row<="10111111";whenO"5"=>col_r<="00000000";col_g<="00011000";row<="11011111";whenO"4"=>col_r<="00000000";col_g<="00011000";row<="11101111";whenO"3"=>col_r<="00000000";col_g<="00011000";row<="11110111";whenO"2"=>col_r<="00000000";col_g<="00011000";row<="11111011";whenO"1"=>col_r<="00000000";col_g<="00011000";row<="11111101";whenO"0"=>col_r<="00000000";col_g<="00011000";row<="11111110";whenOTHERS=>col_r<="00000000";col_g<="00011000";row<="11111110";endcase;whenO"4"=>casesel8is--字母ZwhenO"7"=>col_r<="11111111";col_g<="00000000";row<="01111111";whenO"6"=>col_r<="01000000";col_g<="00000000";row<="10111111";whenO"5"=>col_r<="00100000";col_g<="00000000";row<="11011111";whenO"4"=>col_r<="00010000";col_g<="00000000";row<="11101111";whenO"3"=>col_r<="00001000";col_g<="00000000";row<="11110111";whenO"2"=>col_r<="00000100";col_g<="00000000";row<="11111011";whenO"1"=>col_r<="00000010";col_g<="00000000";row<="11111101";whenO"0"=>col_r<="11111111";col_g<="00000000";row<="11111110";whenOTHERS=>col_r<="11111111";col_g<="00000000";row<="11111110";endcase;whenO"5"=>casesel8is--字母YwhenO"7"=>col_r<="00000000";col_g<="11000011";row<="01111111";whenO"6"=>col_r<="00000000";col_g<="01100110";row<="10111111";whenO"5"=>col_r<="00000000";col_g<="00111100";row<="11011111";whenO"4"=>col_r<="00000000";col_g<="00011000";row<="11101111";whenO"3"=>col_r<="00000000";col_g<="00011000";row<="11110111";whenO"2"=>col_r<="00000000";col_g<="00011000";row<="11111011";whenO"1"=>col_r<="00000000";col_g<="00011000";row<="11111101";whenO"0"=>col_r<="00000000";col_g<="00011000";row<="11111110";whenOTHERS=>col_r<="00000000";col_g<="00011000";row<="11111110";endcase;whenO"6"=>casesel8is--字母RwhenO"7"=>col_r<="00111110";col_g<="00000000";row<="01111111";whenO"6"=>col_r<="01000110";col_g<="00000000";row<="10111111";whenO"5"=>col_r<="01000110";col_g<="00000000";row<="11011111";whenO"4"=>col_r<="00111110";col_g<="00000000";row<="11101111";whenO"3"=>col_r<="01000110";col_g<="00000000";row<="11110111";whenO"2"=>col_r<="10000110";col_g<="00000000";row<="11111011";whenO"1"=>col_r<="10000110";col_g<="00000000";row<="11111101";whenO"0"=>col_r<="00000000";col_g<="00000000";row<="11111110";whenOTHERS=>col_r<="00000000";col_g<="00000000";row<="11111110";endcase;WHENOTHERS=>NULL;--其他狀態(tài)endcase;endprocessp4;enda;第二部分:防抖按鈕。這部分和之前的實(shí)驗(yàn)相仿。直接套用即可。LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYfangdouIS PORT( clk :IN STD_LOGIC; reset :IN STD_LOGIC; resetn :OUT STD_LOGIC);ENDfan

溫馨提示

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

評論

0/150

提交評論