




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 數(shù)字電路與邏輯設(shè)計(jì)實(shí)驗(yàn)報(bào)告 題目:雙色點(diǎn)陣顯示控制器的設(shè)計(jì)與實(shí)現(xiàn) 班級(jí): 學(xué)號(hào): 姓名: 1 實(shí)驗(yàn)要求1.1基本要求:1) 固定紅色顯示一個(gè)漢字或圖形,顯示亮度4級(jí)可調(diào),用一個(gè)btn按鈕實(shí)現(xiàn)亮度調(diào)節(jié),亮度變化視覺效果要盡量明顯。2) 用從紅到綠8級(jí)漸變色顯示一個(gè)固定漢字或圖形。3) 分別用單字循環(huán)顯示、左右滾動(dòng)顯示、上下滾動(dòng)顯示三種顯示方式單色顯示四個(gè)漢字或圖形,顯示過程中,顯示方式用一個(gè)btn按鍵進(jìn)行切換。4) 顯示的圖形或漢字要盡量飽滿美觀。1.2提高要求: 1) 滾動(dòng)顯示過程中實(shí)現(xiàn)四種顯示顏色的自動(dòng)變換,顏色變化視覺效果要盡量明顯。 2) 自擬其它功能。2系統(tǒng)設(shè)計(jì)2.1設(shè)計(jì)思路本實(shí)驗(yàn)采
2、用自頂向下設(shè)計(jì)法:從整個(gè)系統(tǒng)功能出發(fā),按一定原則將系統(tǒng)劃分為若干子系統(tǒng),再將每個(gè)子系統(tǒng)分為若干功能模塊,然后實(shí)現(xiàn)所要求的的功能。總體是通過分頻、按鍵控制、掃描控制等模塊實(shí)現(xiàn)上述功能,通過占空比來改變色彩,實(shí)現(xiàn)八級(jí)漸變色,通過掃描頻率的改變和信號(hào)的占空比實(shí)現(xiàn)亮度的調(diào)節(jié),通過行掃描和列掃描的不同實(shí)現(xiàn)左右滾動(dòng)顯示和上下滾動(dòng)顯示。由于按鍵動(dòng)作的時(shí)刻和按下的時(shí)間長(zhǎng)短是隨機(jī)的,并且存在由開關(guān)簧片反彈導(dǎo)致的電平抖動(dòng),所以還要為每個(gè)按鍵開關(guān)設(shè)置一個(gè)消抖和同步電路,這樣才能保證按鍵的準(zhǔn)確性。2.2總體設(shè)計(jì)框圖1) 總體結(jié)構(gòu)框圖顯示不同的文字或者圖案選擇漢字或圖形選擇顯示模式選擇亮度2) ASM圖開始選擇圖形或文
3、字循環(huán)顯示?no yes調(diào)亮顯示?選擇顯示方式 yes固定紅色調(diào)節(jié)亮度case1? no yes從紅到綠八級(jí)變色nocase2?yes左右滾動(dòng)顯示csae3no上下滾動(dòng)顯示循環(huán)顯示四種顏色自動(dòng)變換 點(diǎn)陣屏顯示如圖所示:開始由按鍵選擇模式,是單個(gè)漸變色顯示,還是循環(huán)顯示,還是可改變亮度顯示,在執(zhí)行的同時(shí)檢查是否按下reset鍵,如果reset鍵被按下,那么將對(duì)系統(tǒng)進(jìn)行復(fù)位。2.3模塊劃分點(diǎn)陣顯示模塊掃描控制模塊分頻模塊邏輯劃分框圖控制器點(diǎn)陣顯示屏分頻電路CP按鍵選擇顯示模式:循環(huán),滾動(dòng)按鍵選擇所要選擇的漢字或圖形按鍵調(diào)節(jié)亮度按鍵消抖動(dòng)同步電路如圖所示:系統(tǒng)主要分成3個(gè)模塊:分頻模塊針對(duì)不同的模式
4、進(jìn)行分頻,掃描控制模塊通過行掃描或者列掃描來控制循環(huán)顯示的方式,點(diǎn)陣顯示模塊主要是響應(yīng)不同模式下的點(diǎn)陣顯示方式及圖形。3 仿真波形及其分析如圖所示 當(dāng)摁下clear鍵時(shí)各信號(hào)復(fù)位,當(dāng)模式按鍵按下并計(jì)數(shù)時(shí),信號(hào)輸出對(duì)應(yīng)各個(gè)模式,桐鄉(xiāng)當(dāng)亮度模式按下時(shí),信號(hào)的占空比改變。4源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity dianzhen isport(clk_in ,clear,btn1,btn2,btn3: in std_l
5、ogic; -定義時(shí)鐘、復(fù)位、按鍵1、2、3colred ,colgreen ,rowout : out std_logic_vector(7 downto 0); -列信號(hào)行信號(hào)輸出 bout0,bout1,bout2,bout3: out std-logic -防抖動(dòng)信號(hào) ); end dianzhen;architecture behave of dianzhen is signal stared ,stagre : std_logic_vector(3 downto 0); signal cred ,row ,cgreen,redtm,gretm : std_logic_vector(
6、7 downto 0); signal smode,sligc,scc : std_logic_vector(1 downto 0); signal zred ,zgreen : std_logic_vector(2 downto 0); signal stm : std_logic_vector(5 downto 0); signal cnt :integer range 0 to 799999; signal xtx :integer range 0 to 99999; signal gun :integer range 0 to 1023999999; signal cnt0,cnt1,
7、cnt2,cnt3: integer range 0 TO 7; signal data0,data1,data2,data3: std_logic; begin process(clk_in,btn1) -brn1鍵防抖動(dòng) beginif(clk_in'event and clk_in = '0') thenif(data0 /= btn1) then cnt0 <= cnt0 + 1;elsecnt0 <= 0;end if;if cnt0 >= 5 thendata0 <= btn1;cnt0 <= 0;end if;end if;b
8、out0 <= data0;end process;process(clk_in,btn2) -btn2鍵防抖動(dòng)beginif (clk_in'event and clk_in = '0') thenif(data1 /= btn2) THEN cnt1 <= cnt1 + 1;elsecnt1 <= 1;end if;if cnt1 >= 5 thendata1 <= btn2;cnt1 <= 1;end if ;end if ;bout1 <= data1;end process;process(clk_in,btn3)-b
9、utton2 -btn3鍵防抖動(dòng)beginif (clk_in'event and clk_in = '0') thenif(data2 /= btn3) thencnt2 <= cnt2 + 1;elsecnt2 <= 0;end if;if cnt2 >= 5 thendata2 <= btn3;cnt2 <= 0;end if;end if;bout2 <= data2;end process; p1:process(clk_in,btn1,btn2,btn3,clear,stared,stagre,zred,zgreen,cn
10、t,gun,xtx) -分頻begin if clear='1' then -復(fù)位模式 smode<="00" sligc<="00" scc<="00" else if (btn1'event and btn1='1' )then -模式選擇、亮度選擇、循環(huán)選擇 smode<=smode+1; end if; if (btn2'event and btn2='1') then sligc<=sligc+1; end if; if (btn3
11、'event and btn3='1') then scc<=scc+1; end if; end if;if (clk_in'event and clk_in='1') then -模式選擇分頻器if cnt=99999 thencnt<=cnt+1;row<="11111110"elsif cnt=199999 thencnt<=cnt+1;row<="11111101"elsif cnt=299999 thencnt<=cnt+1;row<="111
12、11011"elsif cnt=399999 thencnt<=cnt+1;row<="11110111"elsif cnt=499999 thencnt<=cnt+1;row<="11101111"elsif cnt=599999 thencnt<=cnt+1;row<="11011111"elsif cnt=699999 thencnt<=cnt+1;row<="10111111"elsif cnt=799999 thencnt<=cnt+1;ro
13、w<="01111111"else cnt<=cnt+1; end if; if xtx=12499 then -亮度選擇分頻器 xtx<=xtx+1; zred<="000" zgreen<="000" elsif xtx=24999 then xtx<=xtx+1; zred<="001" zgreen<="001" elsif xtx=37499 then xtx<=xtx+1; zred<="010" zgr
14、een<="010" elsif xtx=49999 then xtx<=xtx+1; zred<="011" zgreen<="011"elsif xtx=62499 then xtx<=xtx+1; zred<="100" zgreen<="100" elsif xtx=74999 then xtx<=xtx+1; zred<="101" zgreen<="101" elsif xtx=874
15、99 then xtx<=xtx+1; zred<="110" zgreen<="110" elsif xtx=99999 then xtx<=xtx+1; zred<="111" zgreen<="111" else xtx<=xtx+1; end if; if gun=31999999 then -掃描分頻器 gun<=gun+1; stm<="000001" elsif gun=63999999 then gun<=gun+1;
16、stm<="000000" elsif gun=95999999 then gun<=gun+1; stm<="000010" elsif gun=127999999 then gun<=gun+1; stm<="000000" elsif gun=159999999 then gun<=gun+1; stm<="000011" elsif gun=191999999 then gun<=gun+1; stm<="000000" elsif
17、gun=223999999 then gun<=gun+1; stm<="000100" elsif gun=255999999 then gun<=gun+1; stm<="000000" elsif gun=287999999 then gun<=gun+1; stm<="000101" elsif gun=319999999 then gun<=gun+1; stm<="000000" elsif gun=351999999 then gun<=gun+1
18、; stm<="000110" elsif gun=383999999 then gun<=gun+1; stm<="000000" elsif gun=415999999 then gun<=gun+1; stm<="000111" elsif gun=447999999 then gun<=gun+1; stm<="000000" elsif gun=479999999 then gun<=gun+1; stm<="001000" els
19、if gun=511999999 then gun<=gun+1; stm<="000000" elsif gun=543999999 then gun<=gun+1; stm<="001001" elsif gun=575999999 then gun<=gun+1; stm<="000000" elsif gun=607999999 then gun<=gun+1; stm<="001010" elsif gun=639999999 then gun<=gu
20、n+1; stm<="000000" elsif gun=671999999 then gun<=gun+1; stm<="001011" elsif gun=703999999 then gun<=gun+1; stm<="000000" elsif gun=735999999 then gun<=gun+1; stm<="001100" elsif gun=767999999 then gun<=gun+1; stm<="000000"
21、elsif gun=799999999 then gun<=gun+1; stm<="001101" elsif gun=831999999 then gun<=gun+1; stm<="000000" elsif gun=863999999 then gun<=gun+1; stm<="001110" elsif gun=895999999 then gun<=gun+1; stm<="000000" elsif gun=927999999 then gun<
22、=gun+1; stm<="001111" elsif gun=959999999 then gun<=gun+1; stm<="000000" elsif gun=991999999 then gun<=gun+1; stm<="010000" elsif gun=1023999999 then gun<=gun+1; stm<="000000"end if; end if; case stared is -紅色信號(hào)控制 when "0000" =&g
23、t;redtm<="00000000" when "0001" => case zred is when "000"=>redtm<="11111111" when others=>redtm<="00000000" end case; when "0010"=> case zred is when "000"=>redtm<="11111111" when "001&qu
24、ot;=>redtm<="11111111" when others=>redtm<="00000000" end case; when "0011"=> case zred is when "000"=>redtm<="11111111" when "001"=>redtm<="11111111" when "010"=>redtm<="11111111&qu
25、ot; when others=>redtm<="00000000" end case;when "0100"=> case zred is when "000"=>redtm<="11111111" when "001"=>redtm<="11111111" when "010"=>redtm<="11111111" when "011"=>redtm&l
26、t;="11111111" when others=>redtm<="00000000" end case; when "0101"=> case zred is when "111"=>redtm<="00000000" when "110"=>redtm<="00000000" when "101"=>redtm<="00000000" when others
27、=>redtm<="11111111" end case;when "0110"=> case zred is when "111"=>redtm<="00000000" when "110"=>redtm<="00000000" when others=>redtm<="11111111" end case;when "0111"=> case zred is when &q
28、uot;111"=>redtm<="00000000" when others=>redtm<="11111111" end case; when "1000"=>redtm<="11111111" when others =>redtm<="11111111" end case; case stagre is -綠色信號(hào)控制 when "0000" =>gretm<="00000000"
29、; when "0001" => case zgreen is when "000"=>gretm<="11111111" when others=>gretm<="00000000" end case; when "0010"=> case zgreen is when "000"=>gretm<="11111111" when "001"=>gretm<="111
30、11111" when others=>gretm<="00000000" end case; when "0011"=> case zgreen is when "000"=>gretm<="11111111" when "001"=>gretm<="11111111" when "010"=>gretm<="11111111" when others=>gretm
31、<="00000000" end case;when "0100"=> case zgreen is when "000"=>gretm<="11111111" when "001"=>gretm<="11111111" when "010"=>gretm<="11111111" when "011"=>gretm<="11111111"
32、 when others=>gretm<="00000000" end case; when "0101"=> case zgreen is when "111"=>gretm<="00000000" when "110"=>gretm<="00000000" when "101"=>gretm<="00000000" when others=>gretm<="
33、11111111" end case;when "0110"=> case zgreen is when "111"=>gretm<="00000000" when "110"=>gretm<="00000000" when others=>gretm<="11111111" end case;when "0111"=> case zgreen is when "111"=>
34、;gretm<="00000000" when others=>gretm<="11111111" end case; when "1000"=>gretm<="11111111" when others =>gretm<="11111111" end case; end process; p2:process(smode,sligc,row,scc,stm) - 單字顯示“手”begin case smode iswhen "00"
35、=>case sligc is when "00" =>stared<="1000"when "01" =>stared<="0110"when "10" =>stared<="0011"when "11" =>stared<="0001"when others =>stared<="1000"end case;case row iswhen &quo
36、t;11111110"=>cred<="00001000"when "11111101"=>cred<="00011000"when "11111011"=>cred<="00101000"when "11110111"=>cred<="01111110"when "11101111"=>cred<="11111111"when "110
37、11111"=>cred<="00001000"when "10111111"=>cred<="00011000"when "01111111"=>cred<="00001000"when others=>cred<="00000000"end case; when "01"=> case row iswhen "11111110"=>stared<="
38、;0111"stagre<="0000"cred<="00001000"cgreen<="00001000"when "11111101"=>stared<="0110"stagre<="0001"cred<="00011000"cgreen<="00011000"when "11111011"=>stared<="0101"s
39、tagre<="0010"cred<="00101000"cgreen<="00101000"when "11110111"=>stared<="0100"stagre<="0011"cred<="01111110"cgreen<="01111110"when "11101111"=>stared<="0011"stagre<=&q
40、uot;0100"cred<="11111111"cgreen<="11111111"when "11011111"=>stared<="0010"stagre<="0101"cred<="00001000"cgreen<="00001000"when "10111111"=>stared<="0001"stagre<="0110&quo
41、t;cred<="00011000"cgreen<="00011000"when "01111111"=>stared<="0000"stagre<="0111"cred<="00001000"cgreen<="00001000"when others=>stared<="1000"stagre<="0000"cred<="00000000&
42、quot;cgreen<="00000000"end case;when "10"=> -單字左右滾動(dòng)顯示“手” case scc iswhen "00"=> case stm is when"000001"=> stared<="0111"stagre<="0000" case row is -1when "11111110"=>cred<="00001000"cgreen<=&q
43、uot;00001000"when "11111101"=>cred<="00011000"cgreen<="00011000"when "11111011"=>cred<="00101000"cgreen<="00101000"when "11110111"=>cred<="01111110"cgreen<="01111110"when "1
44、1101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00001000"cgreen<="00001000"when "10111111"=>cred<="00011000"cgreen<="00011000"when "01111111"=>cred<=&qu
45、ot;00001000"cgreen<="00001000"when others=>cred<="00000000"cgreen<="00000000"end case;when"000010"=>stared<="0110"stagre<="0001" case row is -2when "11111110"=>cred<="00010000"cgreen<=&
46、quot;00010000"when "11111101"=>cred<="00110000"cgreen<="00110000"when "11111011"=>cred<="01010000"cgreen<="01010000"when "11110111"=>cred<="11111100"cgreen<="11111100"when "
47、11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00010000"cgreen<="00010000"when "10111111"=>cred<="00110000"cgreen<="00110000"when "01111111"=>cred<=&q
48、uot;00010000"cgreen<="00010000"when others=>cred<="00000000"cgreen<="00000000"end case;when"000011"=> -3stared<="0101"stagre<="0010" case row is when "11111110"=>cred<="00100000"cgreen<
49、="00100000"when "11111101"=>cred<="01100000"cgreen<="01100000"when "11111011"=>cred<="10100000"cgreen<="10100000"when "11110111"=>cred<="11111001"cgreen<="11111001"when &quo
50、t;11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00100000"cgreen<="00100000"when "10111111"=>cred<="01100000"cgreen<="01100000"when "01111111"=>cred<=
51、"00100000"cgreen<="00100000"when others=>cred<="00000000"cgreen<="00000000"end case;when"000100"=> -4stared<="0100"stagre<="0011" case row is when "11111110"=>cred<="01000000"cgreen&l
52、t;="01000000"when "11111101"=>cred<="11000000"cgreen<="11000000"when "11111011"=>cred<="01000001"cgreen<="01000001"when "11110111"=>cred<="11110011"cgreen<="11110011"when &q
53、uot;11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="01000000"cgreen<="01000000"when "10111111"=>cred<="11000000"cgreen<="11000000"when "01111111"=>cred<
54、;="01000000"cgreen<="01000000"when others=>cred<="00000000"cgreen<="00000000"end case;when"000101"=> -5stared<="0011"stagre<="0100" case row is when "11111110"=>cred<="10000000"cgreen
55、<="10000000"when "11111101"=>cred<="10000001"cgreen<="10000001"when "11111011"=>cred<="10000010"cgreen<="10000010"when "11110111"=>cred<="11100111"cgreen<="11100111"when
56、"11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="10000000"cgreen<="10000000"when "10111111"=>cred<="10000001"cgreen<="10000001"when "01111111"=>cred&
57、lt;="10000000"cgreen<="10000000"when others=>cred<="00000000"cgreen<="00000000"end case; when"000110"=> -6stared<="0010"stagre<="0101" case row is when "11111110"=>cred<="00000001"cgr
58、een<="00000001"when "11111101"=>cred<="00000011"cgreen<="00000011"when "11111011"=>cred<="00000101"cgreen<="00000101"when "11110111"=>cred<="11001111"cgreen<="11001111"wh
59、en "11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00000001"cgreen<="00000001"when "10111111"=>cred<="00000011"cgreen<="00000011"when "01111111"=>cr
60、ed<="00000001"cgreen<="00000001"when others=>cred<="00000000"cgreen<="00000000"end case;when"000111"=> -7stared<="0001"stagre<="0110" case row is when "11111110"=>cred<="00000010"c
61、green<="00000010"when "11111101"=>cred<="00000110"cgreen<="00000110"when "11111011"=>cred<="00001010"cgreen<="00001010"when "11110111"=>cred<="10011111"cgreen<="10011111"
62、when "11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00000010"cgreen<="00000010"when "10111111"=>cred<="00000110"cgreen<="00000110"when "01111111"=>
63、cred<="00000010"cgreen<="00000010"when others=>cred<="00000000"cgreen<="00000000"end case;when"001000"=> -8stared<="0000"stagre<="0111" case row is when "11111110"=>cred<="00000100"
64、;cgreen<="00000100"when "11111101"=>cred<="00001100"cgreen<="00001100"when "11111011"=>cred<="00010100"cgreen<="00010100"when "11110111"=>cred<="00111111"cgreen<="00111111&quo
65、t;when "11101111"=>cred<="11111111"cgreen<="11111111"when "11011111"=>cred<="00000100"cgreen<="00000100"when "10111111"=>cred<="00001100"cgreen<="00001100"when "01111111"=&g
66、t;cred<="00000100"cgreen<="00000100"when others=>cred<="00000000"cgreen<="00000000"end case;when others=>cred<="00000000"cgreen<="00000000"end case; when "01"=> -左右滾動(dòng)顯示“郵電大學(xué)” case stm is when"000001
67、"=> stared<="0111"stagre<="0000" case row is -1幀when "11111110"=>cred<="00100000"cgreen<="00100000"when "11111101"=>cred<="00100111"cgreen<="00100111"when "11111011"=>cred<="11111110"cgreen<="11111110"when "11110111"=>cred<="10101100"cgreen<="10101100"when
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 成長(zhǎng)記錄袋小學(xué)生課件
- 2025年環(huán)保廁所項(xiàng)目合作計(jì)劃書
- 2025年重鉻酸鈉項(xiàng)目建議書
- 加強(qiáng)網(wǎng)絡(luò)信息安全保障條例
- 公司股份制實(shí)施方案
- 金融投資顧問投資風(fēng)險(xiǎn)提示書
- 小王子電影故事解讀
- StA-IFN-1-生命科學(xué)試劑-MCE
- 石油庫(kù)區(qū)員工年終總結(jié)
- 2025年太陽(yáng)能熱發(fā)電系統(tǒng)項(xiàng)目合作計(jì)劃書
- TPU材料項(xiàng)目可行性研究報(bào)告寫作參考范文
- 試用期考核合格證明表
- 常見八種疾病
- 膠粘劑基礎(chǔ)知識(shí)及產(chǎn)品詳解(課堂PPT)
- 鍋爐補(bǔ)給水陰陽(yáng)混床操作步序表
- 2005年第4季度北京住房租賃指導(dǎo)價(jià)格
- 醫(yī)療器械GMP計(jì)算機(jī)軟件確認(rèn)控制程序
- 蘇教版最新五年級(jí)數(shù)學(xué)上冊(cè)應(yīng)用題與解決問題專項(xiàng)
- 髖關(guān)節(jié)置換術(shù)男性患者留置尿管最佳時(shí)機(jī)探析和對(duì)策
- [爆笑小品校園劇本7人]爆笑小品校園劇本
- 岸邊集裝箱起重機(jī)CMS系統(tǒng)
評(píng)論
0/150
提交評(píng)論