




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、LED點陣屏上文字顯示實驗李宇 pb09013011實驗要求:在試驗板的8×8的LED點陣屏上分別顯示“PLD電子技術”。編程思想:1.首先定義控制LED點陣屏的端口組a,b,及時鐘和復位端口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結構如下圖所示 從圖中可以看出,8X8點陣共需要64個發光二極管組成,且每個發光二極管是放置在行線和列線的交叉點上,當對應的某一列置0電平,某一行置0電平,則相應的二極管就亮;本程序中是通過對行掃描,并對當前行中需要亮燈的列置0來實現顯示過程。示例程序段如下: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用來對LED掃描分頻用 -count1用
7、來產生1HZ的分頻信號signal count1:INTEGER RANGE 0 to 49999999:=0;signal m:integer:=0;-用m的數值來選擇該掃描顯示那個字beginprocess(reset,clkbegin-復位時的表現為屏上的燈全部點亮if(reset='0' thena<="00000000"b<="00000000"count<=0;m<=0;count1<=0;elseif(rising_edge(clk thenif count1=49999999 then -一赫
8、茲的分頻信號產生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"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時顯示“L”,時長同樣為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”,時長為一秒 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顯示“電”,時長為一秒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顯示“子”,時長為一秒 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顯示“技”,時長為一秒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顯示“術”,時長為一秒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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 工作與生活場景下的智能穿戴需求分析
- 工作中的心理調適與健康管理
- 工作中的時間管理與優化
- 工作場所心理健康關注與干預措施
- 工業設備涂裝的耐腐蝕性研究
- 工作分析與職位設置
- 工作環境創新與員工工作動力提升
- 工作報告的炫酷動態效果制作
- 工程師必 備的數據分析技能
- 工程質量管理與工程驗收標準研究
- 餐飲服務行業食品安全管理人員知識考試題庫(附答案)
- 太陽系中的有趣科學學習通超星期末考試答案章節答案2024年
- 上海市幼兒園幼小銜接活動指導意見(修訂稿)
- 培訓學校收費和退費管理制度
- 法社會學教程(第三版)教學
- 國內外高等教育教材比較研究課題
- 浙江省紹興市諸暨市2023-2024學年五年級下學期期末數學試卷
- 煤礦調度智能化培訓課件
- 基于PLC的啤酒發酵自動控制系統
- 重慶市沙坪壩區2022-2023學年八年級下學期期末英語試題
- 思辨與創新智慧樹知到期末考試答案章節答案2024年復旦大學
評論
0/150
提交評論