




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、LED點(diǎn)陣屏上文字顯示實(shí)驗(yàn)李宇 pb09013011實(shí)驗(yàn)要求:在試驗(yàn)板的8×8的LED點(diǎn)陣屏上分別顯示“PLD電子技術(shù)”。編程思想:1.首先定義控制LED點(diǎn)陣屏的端口組a,b,及時(shí)鐘和復(fù)位端口Port ( a : inout STD_LOGIC_VECTOR (7 downto 0;b : inout STD_LOGIC_VECTOR (7 downto 0;clk : in STD_LOGIC;reset : in STD_LOGIC;2.字的跳變顯示是通過改變整型變量m的值來選擇掃描的程序段3.對(duì)LED點(diǎn)陣屏的工作方式清楚,XUP板子上采用的是共陰極8x8點(diǎn)陣LED。8X8點(diǎn)陣L
2、ED結(jié)構(gòu)如下圖所示 從圖中可以看出,8X8點(diǎn)陣共需要64個(gè)發(fā)光二極管組成,且每個(gè)發(fā)光二極管是放置在行線和列線的交叉點(diǎn)上,當(dāng)對(duì)應(yīng)的某一列置0電平,某一行置0電平,則相應(yīng)的二極管就亮;本程序中是通過對(duì)行掃描,并對(duì)當(dāng)前行中需要亮燈的列置0來實(shí)現(xiàn)顯示過程。示例程序段如下:if(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="10111111"count<
3、=count+1;elsif(count=3*N/8 thena<="11101111"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101111"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101111"b<="11110111"count<=count+1;elsif(count=N*3/4
4、thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;VHDL代碼:- Company:- Engineer:- Create Date: 10:09:58 0
5、5/24/2012- Design Name:- Module Name: expp8 - Behavioral- Project Name:- Target Devices:- Tool versions:- Description:- Dependencies:- Revision:- Revision 0.01 - File Created- Additional Comments:-library IEEE;- Uncomment the following library declaration if instantiating- any Xilinx primitives in t
6、his code.-library UNISIM;entity expp8 isgeneric(N: integer :=16000;Port ( a : inout STD_LOGIC_VECTOR (7 downto 0;b : inout STD_LOGIC_VECTOR (7 downto 0;clk : in STD_LOGIC;reset : in STD_LOGIC;end expp8;architecture Behavioral of expp8 issignal count:INTEGER RANGE 0 to N:=0;-count用來對(duì)LED掃描分頻用 -count1用
7、來產(chǎn)生1HZ的分頻信號(hào)signal count1:INTEGER RANGE 0 to 49999999:=0;signal m:integer:=0;-用m的數(shù)值來選擇該掃描顯示那個(gè)字beginprocess(reset,clkbegin-復(fù)位時(shí)的表現(xiàn)為屏上的燈全部點(diǎn)亮if(reset='0' thena<="00000000"b<="00000000"count<=0;m<=0;count1<=0;elseif(rising_edge(clk thenif count1=49999999 then -一赫
8、茲的分頻信號(hào)產(chǎn)生m<=m+1;count1<=0;else count1<=count1+1;end if;-m=0時(shí)采用掃描的方式顯示第一個(gè)字母“P”if m=0 then-所選行中點(diǎn)亮的燈的時(shí)間為N/8個(gè)周期 if(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100111"b<="10111111"count<=count+1;elsif(c
9、ount=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101011"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11100111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="
10、11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="11111101"count<=count+1;elsif(count=Nthena<="11101111"b<="11111110"count<=0;elsecount<=count+1;end if;-m=1時(shí)顯示“L”,時(shí)長(zhǎng)同樣為1秒elsif m=1 thenif(count
11、=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101111"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101111
12、"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101111"b<="111111
13、01"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;elsecount<=count+1;end if;-m=2顯示“D”,時(shí)長(zhǎng)為一秒 elsif m=2 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100111"b
14、<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101101"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101101"b<="11110111"co
15、unt<=count+1;elsif(count=N*3/4 thena<="11101101"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101011"b<="11111101"count<=count+1;elsif(count=Nthena<="11100111"b<="11111110"count<=0;elsecount<=count
16、+1;end if;-m=3顯示“電”,時(shí)長(zhǎng)為一秒elsif m=3 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11101111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="10000011"b<="11011111"count<=
17、count+1;elsif(count=N/2thena<="10000011"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="10000011"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 t
18、hena<="11101011"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;elsecount<=count+1;end if;-m=4顯示“子”,時(shí)長(zhǎng)為一秒 elsif m=4 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;
19、elsif(count=N/4 thena<="11100011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11111011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<=&
20、quot;11110111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11110111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11100111"b<="11111101"count<=count+1;elsif(count=Nthena<="11110111"b<=&quo
21、t;11111110"count<=0;elsecount<=count+1;end if;-m=5顯示“技”,時(shí)長(zhǎng)為一秒elsif m=5 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11011011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="100
22、00001"b<="11011111"count<=count+1;elsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11010101"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="10011111"b<="1111
23、1011"count<=count+1;elsif(count=7*N/8 thena<="10011011"b<="11111101"count<=count+1;elsif(count=Nthena<="11010101"b<="11111110"count<=0;elsecount<=count+1;end if;-m=6顯示“術(shù)”,時(shí)長(zhǎng)為一秒elsif m=6 thenif(count=N/8 thena<="11111111&quo
24、t;b<="01111111"count<=count+1;elsif(count=N/4 thena<="11110011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11000001"b<="11011111"count<=count+1;elsif(count=N/2thena<="11110111"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11100011"b<="11110111"count<
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年數(shù)字藝術(shù)與設(shè)計(jì)課程考試卷及答案
- 2025年護(hù)理學(xué)專業(yè)畢業(yè)生實(shí)習(xí)考試試題及答案
- 2025年大數(shù)據(jù)分析師職業(yè)資格考試試題及答案
- 2025年房地產(chǎn)業(yè)務(wù)管理綜合考核試卷及答案
- 屋頂裝修協(xié)議書范本
- 早教工作總結(jié)匯報(bào)
- 秦俑創(chuàng)新美術(shù)課件
- 蠶桑養(yǎng)殖培訓(xùn)講座
- 腫瘤病例診療經(jīng)過圖
- 胃癌患者的防治與護(hù)理
- 中藥煎藥室應(yīng)急預(yù)案
- 華東師大版七年級(jí)數(shù)學(xué)上冊(cè)教學(xué)課件
- 中國(guó)航天(航天科普知識(shí))PPT
- GB/T 27806-2011環(huán)氧瀝青防腐涂料
- GB/T 17949.1-2000接地系統(tǒng)的土壤電阻率、接地阻抗和地面電位測(cè)量導(dǎo)則第1部分:常規(guī)測(cè)量
- 夢(mèng)幻西游古龍服務(wù)端安裝教程
- 《出生醫(yī)學(xué)證明》單親母親情況聲明
- 4配電柜安全風(fēng)險(xiǎn)點(diǎn)告知牌
- 旋挖機(jī)操作手知識(shí)試卷含參考答案
- Q∕GDW 11445-2015 國(guó)家電網(wǎng)公司管理信息系統(tǒng)安全基線要求
- 材料科學(xué)基礎(chǔ) 第2章 晶體結(jié)構(gòu)
評(píng)論
0/150
提交評(píng)論