




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、LED點陣屏上文字顯示實驗李宇 pb09013011實驗要求:在試驗板的8×8的LED點陣屏上分別顯示“PLD電子技術(shù)”。編程思想:1.首先定義控制LED點陣屏的端口組a,b,及時鐘和復(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.對LED點陣屏的工作方式清楚,XUP板子上采用的是共陰極8x8點陣LED。8X8點陣L
2、ED結(jié)構(gòu)如下圖所示 從圖中可以看出,8X8點陣共需要64個發(fā)光二極管組成,且每個發(fā)光二極管是放置在行線和列線的交叉點上,當(dāng)對應(yīng)的某一列置0電平,某一行置0電平,則相應(yīng)的二極管就亮;本程序中是通過對行掃描,并對當(dāng)前行中需要亮燈的列置0來實現(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用來對LED掃描分頻用 -count1用來產(chǎn)生1HZ的分頻信號signal count1:INTEGER RANGE 0 to 49999999:=0;signal m:integer:=0;-用m的數(shù)值來選擇該掃描顯示那個字beginprocess(reset,clkbegin-復(fù)位時的表現(xià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 -一赫茲的分頻信號產(chǎn)生m<=m+1;count1<=0;else count1<=count1+1;end if;-m=0時采用掃描的方式顯示第一個字母“P”if m=0 then-所選行中點亮的燈的時間為N/8個周期 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時顯示“L”,時長同樣為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”,時長為一秒 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顯示“電”,時長為一秒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顯示“子”,時長為一秒 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顯示“技”,時長為一秒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ù)”,時長為一秒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等.壓縮文件請下載最新的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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 關(guān)于項目轉(zhuǎn)讓合同樣本
- 分批次供貨合同標(biāo)準(zhǔn)文本
- 2025年03月福建龍巖市漳平生態(tài)環(huán)境局公開招聘編外聘用人員1人筆試歷年典型考題(歷年真題考點)解題思路附帶答案詳解
- 農(nóng)村公墓建設(shè)合同樣本
- 人工客服借款合同樣本
- 內(nèi)貿(mào)服裝采購合同樣本
- 拔牙正畸護(hù)理查房模板
- 專業(yè)采購合同標(biāo)準(zhǔn)文本
- 買賣原木合同樣本
- 出納會計合同樣本
- 中華民族共同體概論課件專家版4第四講 天下秩序與華夏共同體的演進(jìn)(夏商周時期)
- 2023年海南省初中學(xué)業(yè)水平考試歷史真題(答案詳解)
- UHPC板幕墻施工方案
- 《中國人民站起來了》練習(xí)(含解析) 統(tǒng)編版高中語文選擇性必修上冊
- 創(chuàng)新創(chuàng)效方案
- 非免疫規(guī)劃疫苗接種方案(2023年版)
- 電工證考試題庫app低壓電工證考試
- 路面驗收標(biāo)準(zhǔn)
- 社區(qū)矯正對象書面保護(hù)申請書
- 教師情緒和壓力疏導(dǎo)
- 火龍罐技術(shù)課件
評論
0/150
提交評論