版權(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;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;-
6、 Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;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 S
7、TD_LOGIC;end expp8;architecture Behavioral of expp8 issignal count:INTEGER RANGE 0 to N:=0;-count用來對(duì)LED掃描分頻用 -count1用來產(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&q
8、uot;b<="00000000"count<=0;m<=0;count1<=0;elseif(rising_edge(clk thenif count1=49999999 then -一赫茲的分頻信號(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&quo
9、t;count<=count+1;elsif(count=N/4 thena<="11100111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101011"b<="11101111"count<=count+1;elsif(cou
10、nt=N*5/8 thena<="11100111"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<="11111101"count<=count+1;elsif(count=Nthena<="1110
11、1111"b<="11111110"count<=0;elsecount<=count+1;end if;-m=1時(shí)顯示“L”,時(shí)長(zhǎng)同樣為1秒elsif m=1 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*
12、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 thena<="1110111
13、1"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;elsecount<=count+1;end if;-m=2顯示“D”,時(shí)長(zhǎng)為一秒 elsif m=2 thenif(count=N/8 then
14、a<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100111"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11101011"b<="11011111"count<=count+1;elsif(count=N/2thena<="11101101"b&l
15、t;="11101111"count<=count+1;elsif(count=N*5/8 thena<="11101101"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11101101"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101011"b<="11111101"c
16、ount<=count+1;elsif(count=Nthena<="11100111"b<="11111110"count<=0;elsecount<=count+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<="
17、;10111111"count<=count+1;elsif(count=3*N/8 thena<="10000011"b<="11011111"count<=count+1;elsif(count=N/2thena<="10000011"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="10000011"b<="11110111"count<=co
18、unt+1;elsif(count=N*3/4 thena<="11101111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="11101011"b<="11111101"count<=count+1;elsif(count=Nthena<="11100011"b<="11111110"count<=0;elsecount<=count+1;end if;
19、-m=4顯示“子”,時(shí)長(zhǎng)為一秒 elsif m=4 thenif(count=N/8 thena<="11111111"b<="01111111"count<=count+1;elsif(count=N/4 thena<="11100011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="11111011"b<="11011111"count<=count+1;e
20、lsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11110111"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="11110111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<=
21、"11100111"b<="11111101"count<=count+1;elsif(count=Nthena<="11110111"b<="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(coun
22、t=N/4 thena<="11011011"b<="10111111"count<=count+1;elsif(count=3*N/8 thena<="10000001"b<="11011111"count<=count+1;elsif(count=N/2thena<="11000001"b<="11101111"count<=count+1;elsif(count=N*5/8 thena<="11010
23、101"b<="11110111"count<=count+1;elsif(count=N*3/4 thena<="10011111"b<="11111011"count<=count+1;elsif(count=7*N/8 thena<="10011011"b<="11111101"count<=count+1;elsif(count=Nthena<="11010101"b<="11111110
24、"count<=0;elsecount<=count+1;end if;-m=6顯示“術(shù)”,時(shí)長(zhǎng)為一秒elsif m=6 thenif(count=N/8 thena<="11111111"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&q
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 農(nóng)村農(nóng)副業(yè)承包合同
- 個(gè)人借款合同范本:獨(dú)資經(jīng)營(yíng)者間短期資金周轉(zhuǎn)合同版B版
- 門店裝修合同樣本
- 2025年度車牌租賃業(yè)務(wù)財(cái)務(wù)審計(jì)與稅務(wù)籌劃合同4篇
- 二零二五年度智能打印機(jī)升級(jí)改造與售后服務(wù)合同4篇
- 2025年度木結(jié)構(gòu)建筑構(gòu)件檢測(cè)與認(rèn)證合同4篇
- 二零二五年度木門行業(yè)供應(yīng)鏈金融服務(wù)合同8篇
- 2025年度馬戲團(tuán)演出宣傳與媒體報(bào)道合同4篇
- 2025版圖書館圖書采購(gòu)與版權(quán)保護(hù)宣傳合同3篇
- 2025至2030年中國(guó)中管傾斜式鉸孔機(jī)數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 生物人教版七年級(jí)(上冊(cè))第一章第一節(jié) 生物的特征 (共28張)2024版新教材
- 2025屆安徽省皖南八校高三上學(xué)期8月摸底考試英語(yǔ)試題+
- 工會(huì)資金采購(gòu)管理辦法
- 玩具活動(dòng)方案設(shè)計(jì)
- Q∕GDW 516-2010 500kV~1000kV 輸電線路劣化懸式絕緣子檢測(cè)規(guī)程
- 2024年湖南汽車工程職業(yè)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)及答案解析
- 家長(zhǎng)心理健康教育知識(shí)講座
- GB/T 292-2023滾動(dòng)軸承角接觸球軸承外形尺寸
- 2024年九省聯(lián)考高考數(shù)學(xué)卷試題真題答案詳解(精校打?。?/a>
- 軍人結(jié)婚函調(diào)報(bào)告表
- 民用無人駕駛航空器實(shí)名制登記管理規(guī)定
評(píng)論
0/150
提交評(píng)論