版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
數(shù)電綜合實(shí)驗(yàn)報(bào)告簡易電磁爐控制器的設(shè)計(jì)與實(shí)現(xiàn)姓名XXX班級XXXXXXXXXX學(xué)號XXXXXXXXXX日期2013年11月9日一、設(shè)計(jì)課題任務(wù)要求1、烹飪模式選擇:電磁爐的烹飪模式有火鍋、煎炒、爆炒、煲湯和蒸燉五檔可選。用一個(gè)按鍵(BTN7)實(shí)現(xiàn)烹飪檔位的選擇(按下此鍵依上述順序依次變化),用點(diǎn)陣顯示當(dāng)前的烹調(diào)檔位(火鍋顯示H、煎炒顯示J、爆炒顯示B、煲湯顯示T和蒸燉顯示Z),烹調(diào)檔位的選擇按鍵同時(shí)也是加熱的開始按鍵,即烹調(diào)檔位選定的同時(shí)電磁爐就以最大功率開始加熱,沒有選擇時(shí)電磁爐處于停止?fàn)顟B(tài),點(diǎn)陣不顯示。2、火力調(diào)節(jié):電磁爐的火力分5檔可調(diào):1900W-1500W-1100W-600W-100W,用數(shù)碼管DISP3-DISP0顯示當(dāng)前的火力,用兩個(gè)按鍵(BTN6和BTN5)實(shí)現(xiàn)火力的增加或減少,烹調(diào)過程中,除爆炒模式外,其它模式均可以隨時(shí)可以調(diào)節(jié)火力,爆炒模式只能以最高功率加熱。3、定時(shí)功能:用一個(gè)按鍵(BTN4)實(shí)現(xiàn)定時(shí)設(shè)置,按下定時(shí)鍵,蜂鳴器響一聲,每按一次定時(shí)鍵,定時(shí)時(shí)間以5-10-30-60秒鐘的順序依次遞增,定時(shí)設(shè)定完畢后,電磁爐開始倒計(jì)時(shí)。用數(shù)碼管DISP5和DISP4顯示定時(shí)檔位和倒計(jì)時(shí)的過程,倒計(jì)時(shí)時(shí)間到后,電磁爐自動停止加熱并關(guān)機(jī)。4、不進(jìn)行定時(shí)操作時(shí),電磁爐以默認(rèn)加熱時(shí)間進(jìn)行加熱。蒸燉模式的默認(rèn)時(shí)間為20秒鐘;爆炒模式的默認(rèn)時(shí)間是3秒鐘,爆炒3秒鐘后自動返回煎炒模式;其他模式的默認(rèn)時(shí)間為90秒。5、用點(diǎn)亮的發(fā)光二極管LD4表示開機(jī)加熱,熄滅表示關(guān)機(jī)。6、設(shè)置關(guān)閉鍵,任何時(shí)候按下關(guān)閉鍵即可將電磁爐關(guān)機(jī)。二、系統(tǒng)設(shè)計(jì)(包括設(shè)計(jì)思路、總體框圖、分塊設(shè)計(jì))1、設(shè)計(jì)思路:由一個(gè)總控制器控制完成各個(gè)狀態(tài)轉(zhuǎn)換。主要分為3個(gè)狀態(tài)分別為等待狀態(tài),正常工作狀態(tài)和爆炒狀態(tài)。沒有任何操作時(shí)電路不工作即停留在等待狀態(tài);當(dāng)模式調(diào)節(jié)被按下時(shí),電路進(jìn)入工作狀態(tài),工作狀態(tài)包括:火鍋顯示H、煎炒顯示J、煲湯顯示T和蒸燉顯示Z。時(shí)間設(shè)置,模式選擇,火力調(diào)節(jié)等操作均在此工作狀態(tài)下循環(huán)。當(dāng)時(shí)間倒計(jì)時(shí)結(jié)束或停止鍵被按下,回到等待狀態(tài);特別的,當(dāng)工作模式調(diào)節(jié)到爆炒模式時(shí),火力最大不可調(diào),當(dāng)時(shí)間倒計(jì)時(shí)結(jié)束時(shí),回到工作模式,當(dāng)停止鍵被按下時(shí)回到等待模式??紤]到鍵盤輸入不穩(wěn)定,數(shù)字跳變太快所以要加入防抖動模塊;時(shí)間倒計(jì)時(shí)需要1hz的時(shí)鐘頻率,所以需要分頻模塊;除此之外還需要模式選擇模塊、狀態(tài)選擇模塊、火力調(diào)節(jié)模塊、定時(shí)模塊、數(shù)碼管顯示模塊、點(diǎn)陣顯示模塊、LED顯示模塊、蜂鳴器模塊。2、總體框圖總體框圖數(shù)字譯碼與顯示倒計(jì)時(shí)數(shù)字譯碼與顯示倒計(jì)時(shí)防抖分頻器控制器點(diǎn)陣顯示模式選擇鍵盤輸入防抖分頻器控制器點(diǎn)陣顯示模式選擇鍵盤輸入火力選擇火力選擇數(shù)碼管顯示狀態(tài)轉(zhuǎn)移圖流程圖模式模式爆炒炒?火力NO開始計(jì)時(shí)定時(shí)?默認(rèn)定時(shí)結(jié)束調(diào)火?火力調(diào)節(jié)是否是否是3、分塊設(shè)計(jì)(1)防抖模塊time<=t、ime_d1and(nottime_d2);mode<=mode_d1and(notmode_d2);levelup<=levelup_d1and(notlevelup_d2);leveldown<=leveldown_d1and(notleveldown_d2);process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thentime_d1<='0';time_d2<='0';elsif(clk_i'eventandclk_i='1')thentime_d1<=time_i;time_d2<=time_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenmode_d1<='0';mode_d2<='0';elsif(clk_i'eventandclk_i='1')thenmode_d1<=mode_i;mode_d2<=mode_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenlevelup_d1<='0';levelup_d2<='0';elsif(clk_i'eventandclk_i='1')thenlevelup_d1<=levelup_i;levelup_d2<=levelup_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenleveldown_d1<='0';leveldown_d2<='0';elsif(clk_i'eventandclk_i='1')thenleveldown_d1<=leveldown_i;leveldown_d2<=leveldown_d1;endif;endprocess;(2)分頻模塊PROCESS(reset_i,clk)Variabletmp:integerrange0to50;BEGIN IFreset_i='1'THEN tmp:=0; ELSIFclk'eventANDclk='1'THEN IFtmp=50THEN tmp:=0; ELSE tmp:=tmp+1; ENDIF; IFtmp<50THEN clk_i<='1'; ELSE clk_i<='0'; ENDIF;ENDIF;ENDPROCESS;Process(reset_i,clk_i)Variablei:integerrange0to999999;Beginif(reset_i='1'andreset_i='1')thenclk_1s<='0';i:=0;elsif(clk_i'eventandclk_i='1')thenif(load='1'andload='1')theni:=0;elsif(i=999999)thenclk_1s<='1';i:=0;elseclk_1s<='0';i:=i+1;endif;endif;Endprocess;(3)狀態(tài)選擇模塊process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thencur_state<=StateWait;elsif(clk_i'eventandclk_i='1')thencur_state<=next_state;endif;endprocess;(4)模式選擇模塊rocess(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thenmode_cnt<=5;elsif(clk_i'eventandclk_i='1')thenif(timeout='1'andmode_cnt=2)thenmode_cnt<=1;elsif(mode='1'andmode='1')thenif(mode_cnt<4)thenmode_cnt<=mode_cnt+1;elsemode_cnt<=0;endif;endif;endif;(5)火力調(diào)節(jié)模塊Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thenlevel_cnt<=4;elsif(clk_i'eventandclk_i='1')thenif(mode_cnt=2)thenlevel_cnt<=4;elsif(timeout='1')thenlevel_cnt<=4;elsif(levelup='1')thenif(level_cnt<4)thenlevel_cnt<=level_cnt+1;elselevel_cnt<=4;endif;elsif(leveldown='1'andleveldown='1')thenif(level_cnt>0)thenlevel_cnt<=level_cnt-1;elselevel_cnt<=0;endif;endif;endif;(6)時(shí)間選擇模塊Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thentime_cnt<=0;elsif(clk_i'eventandclk_i='1')thenif(mode='1'ortimeout='1')thentime_cnt<=0;elsif(time='1')thenif(time_cnt<4)thentime_cnt<=time_cnt+1;elsetime_cnt<=1;endif;endif;endif;(7)數(shù)碼管顯示模塊Process(seg_cat)begincase(seg_cat)iswhen0=>cat_o<="011111";--數(shù)碼管掃描when1=>cat_o<="101111";when2=>cat_o<="110111";when3=>cat_o<="111011";when4=>cat_o<="111101";when5=>cat_o<="111110";whenothers=>cat_o<="111111";endcase;endprocess;Process(seg_cat)begincase(seg_cat)iswhen0=>seg<=time_bcd_h;--數(shù)碼管的掃描when1=>seg<=time_bcd_l;when2=>seg<=level_bcd_3;when3=>seg<=level_bcd_2;when4=>seg<=level_bcd_1;when5=>seg<=level_bcd_0;whenothers=>seg<="0000";endcase;endprocess;Process(seg)begincase(seg)iswhen"0000"=>seg7_o<="11111100";--數(shù)碼管輸出when"0001"=>seg7_o<="01100000";when"0010"=>seg7_o<="11011010";when"0011"=>seg7_o<="11110010";when"0100"=>seg7_o<="01100110";when"0101"=>seg7_o<="10110110";when"0110"=>seg7_o<="10111110";when"0111"=>seg7_o<="11100000";when"1000"=>seg7_o<="11111110";when"1001"=>seg7_o<="11110110";whenothers=>seg7_o<="00000000";endcase;endprocess;(8)點(diǎn)陣顯示模塊Process(timer_cnt)begincase(timer_cnt)iswhen0|1|2|3|4|5|6|7|8|9=>time_bcd_h<="0000";when10|11|12|13|14|15|16|17|18|19=>time_bcd_h<="0001";when20|21|22|23|24|25|26|27|28|29=>time_bcd_h<="0010";when30|31|32|33|34|35|36|37|38|39=>time_bcd_h<="0011";when40|41|42|43|44|45|46|47|48|49=>time_bcd_h<="0100";when50|51|52|53|54|55|56|57|58|59=>time_bcd_h<="0101";when60|61|62|63|64|65|66|67|68|69=>time_bcd_h<="0110";when70|71|72|73|74|75|76|77|78|79=>time_bcd_h<="0111";when80|81|82|83|84|85|86|87|88|89=>time_bcd_h<="1000";when90=>time_bcd_h<="1001";whenothers=>time_bcd_h<="0000";endcase;endprocess;Process(timer_cnt)begincase(timer_cnt)iswhen0|10|20|30|40|50|60|70|80|90=>time_bcd_l<="0000";when1|11|21|31|41|51|61|71|81=>time_bcd_l<="0001";when2|12|22|32|42|52|62|72|82=>time_bcd_l<="0010";when3|13|23|33|43|53|63|73|83=>time_bcd_l<="0011";when4|14|24|34|44|54|64|74|84=>time_bcd_l<="0100";when5|15|25|35|45|55|65|75|85=>time_bcd_l<="0101";when6|16|26|36|46|56|66|76|86=>time_bcd_l<="0110";when7|17|27|37|47|57|67|77|87=>time_bcd_l<="0111";when8|18|28|38|48|58|68|78|88=>time_bcd_l<="1000";when9|19|29|39|49|59|69|79|89=>time_bcd_l<="1001";whenothers=>time_bcd_l<="0000";endcase;endprocess;(9)led燈顯示模塊Process(led_cnt,work)beginif(work='1')thenled_o<='1';elseled_o<='0';endif;endprocess;(10)蜂鳴器模塊process(clk_i,work,time)begin if(work='1'andtime_i='1')then sound_o<='1'; else sound_o<='0'; endif;endprocess;三、仿真波形及波形分析點(diǎn)陣:數(shù)碼管:分析:可以看出,隨著時(shí)鐘信號的變化,當(dāng)模式按鍵變化時(shí),點(diǎn)陣會依次顯示出相應(yīng)的符號;當(dāng)定時(shí)鍵變化時(shí),數(shù)碼管會依次顯示預(yù)定時(shí)間;當(dāng)火力按鍵變化時(shí),數(shù)碼管也會顯示相應(yīng)火力大小。四、源程序libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entitydianciluisport(clk:instd_logic;reset_i:instd_logic;--停止鍵mode_i:instd_logic;--模式選擇鍵time_i:instd_logic;--時(shí)間設(shè)定鍵levelup_i:instd_logic;--火力增加leveldown_i:instd_logic;--火力減小seg7_o:outstd_logic_vector(7downto0);--數(shù)碼管cat_o:outstd_logic_vector(5downto0);col_o:outstd_logic_vector(7downto0);--點(diǎn)陣row_o:outstd_logic_vector(7downto0);led_o:outstd_logic;--led燈sound_o:outstd_logic--蜂鳴器);enddiancilu;architecturertlofdianciluistypestate_typeis(StateWait,StateRun,StateQuickFried);--停止工作狀態(tài)、正常工作狀態(tài)(除爆炒模式)、爆炒狀態(tài)signalcur_state,next_state:state_type;signalclk_i:std_logic;signaltime:std_logic;--時(shí)間選擇signaltime_d1,time_d2:std_logic;signalmode:std_logic;--模式選擇signalmode_d1,mode_d2:std_logic; signallevelup:std_logic;--火力 signalleveldown:std_logic; signallevelup_d1,levelup_d2:std_logic; signalleveldown_d1,leveldown_d2:std_logic;signaltimeout:std_logic;--計(jì)時(shí)結(jié)束signalwork:std_logic;signalload:std_logic;signalled_cnt:std_logic;--各種計(jì)數(shù)signaltime_cnt:integerrange0to4;signalmode_cnt:integerrange0to5;signallevel_cnt:integerrange0to4;signaltimer_set:integerrange0to90;signaltimer_cnt:integerrange0to90;signalclk_1s:std_logic;signalseg_cat:integerrange0to6;signaltime_bcd_h:std_logic_vector(3downto0);signaltime_bcd_l:std_logic_vector(3downto0);signallevel_bcd_3:std_logic_vector(3downto0);signallevel_bcd_2:std_logic_vector(3downto0);signallevel_bcd_1:std_logic_vector(3downto0);signallevel_bcd_0:std_logic_vector(3downto0);signalseg:std_logic_vector(3downto0);signalrow_sel:integerrange0to8;signalcol_0:std_logic_vector(7downto0);signalcol_1:std_logic_vector(7downto0);signalcol_2:std_logic_vector(7downto0);signalcol_3:std_logic_vector(7downto0);signalcol_4:std_logic_vector(7downto0);signalcol_5:std_logic_vector(7downto0);signalcol_6:std_logic_vector(7downto0);signalcol_7:std_logic_vector(7downto0);signalclk_500hz:std_logic;begin----------------------------------------------------------------防抖--------------------------------------------------------------time<=time_d1and(nottime_d2);mode<=mode_d1and(notmode_d2);levelup<=levelup_d1and(notlevelup_d2);leveldown<=leveldown_d1and(notleveldown_d2);process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thentime_d1<='0';time_d2<='0';elsif(clk_i'eventandclk_i='1')thentime_d1<=time_i;time_d2<=time_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenmode_d1<='0';mode_d2<='0';elsif(clk_i'eventandclk_i='1')thenmode_d1<=mode_i;mode_d2<=mode_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenlevelup_d1<='0';levelup_d2<='0';elsif(clk_i'eventandclk_i='1')thenlevelup_d1<=levelup_i;levelup_d2<=levelup_d1;endif;endprocess;process(reset_i,clk_i)beginif(reset_i='1'andreset_i='1')thenleveldown_d1<='0';leveldown_d2<='0';elsif(clk_i'eventandclk_i='1')thenleveldown_d1<=leveldown_i;leveldown_d2<=leveldown_d1;endif;endprocess;----------------------------------------------------------------MainStatemachine控制狀態(tài)--------------------------------------------------------------process(reset_i,clk_i)--狀態(tài)轉(zhuǎn)移beginif(reset_i='1'andreset_i='1')thencur_state<=StateWait;elsif(clk_i'eventandclk_i='1')thencur_state<=next_state;endif;endprocess;process(cur_state,timeout,mode,mode_cnt)--具體狀態(tài)轉(zhuǎn)移關(guān)系begincase(cur_state)iswhenStateWait=>--statewait狀態(tài)下按下mode跳到staterun狀態(tài)if(mode='1'andmode='1')thennext_state<=StateRun;elsenext_state<=StateWait;endif;whenStateRun=>--staterun狀態(tài)下if(timeout='1'andload/='1')then--倒計(jì)時(shí)結(jié)束next_state<=StateWait;elsif(mode_cnt=2)then--mode按下2次next_state<=StateQuickFried;elsenext_state<=StateRun;--其余情況在staterun循環(huán)endif;whenStateQuickFried=>--StateQuickFried狀態(tài)下if(timeout='1'ormode_cnt/=2)then--倒計(jì)時(shí)結(jié)束或mode_cnt不為2next_state<=StateRun;elsenext_state<=StateQuickFried;endif;endcase;Endprocess;Process(cur_state)Begincase(cur_state)iswhenStateWait=>work<='0';whenStateRun=>work<='1';whenStateQuickFried=>work<='1';endcase;Endprocess;----------------------------------------------------------------modecounter模式計(jì)數(shù)--------------------------------------------------------------Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thenmode_cnt<=5;elsif(clk_i'eventandclk_i='1')thenif(timeout='1'andmode_cnt=2)thenmode_cnt<=1;elsif(mode='1'andmode='1')thenif(mode_cnt<4)thenmode_cnt<=mode_cnt+1;elsemode_cnt<=0;endif;endif;endif;Endprocess;----------------------------------------------------------------timecounter時(shí)間選擇計(jì)數(shù)--------------------------------------------------------------Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thentime_cnt<=0;elsif(clk_i'eventandclk_i='1')thenif(mode='1'ortimeout='1')thentime_cnt<=0;elsif(time='1')thenif(time_cnt<4)thentime_cnt<=time_cnt+1;elsetime_cnt<=1;endif;endif;endif;Endprocess;----------------------------------------------------------------levelcounter火力選擇計(jì)數(shù)--------------------------------------------------------------Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thenlevel_cnt<=4;elsif(clk_i'eventandclk_i='1')thenif(mode_cnt=2)thenlevel_cnt<=4;elsif(timeout='1')thenlevel_cnt<=4;elsif(levelup='1')thenif(level_cnt<4)thenlevel_cnt<=level_cnt+1;elselevel_cnt<=4;endif;elsif(leveldown='1'andleveldown='1')thenif(level_cnt>0)thenlevel_cnt<=level_cnt-1;elselevel_cnt<=0;endif;endif;endif;Endprocess;----------------------------------------------------------------loadsignal--------------------------------------------------------------Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thenload<='0';elsif(clk_i'eventandclk_i='1')thenif(mode_cnt=2andtimeout='1')thenload<='1';elsif(mode='1'ortime='1')thenload<='1';elseload<='0';endif;endif;Endprocess;----------------------------------------------------------------timersetsignal--------------------------------------------------------------Process(time_cnt,mode_cnt)Beginif(mode_cnt=4andtime_cnt=0)thentimer_set<=20;elsif(mode_cnt=2andtime_cnt=0)thentimer_set<=3;elsif(time_cnt=1)then--iftimer_set<=5;elsif(time_cnt=2)thentimer_set<=10;elsif(time_cnt=3)thentimer_set<=30;elsif(time_cnt=4)thentimer_set<=60;elsetimer_set<=90;Endif;Endprocess;----------------------------------------------------------------timedown--------------------------------------------------------------Process(reset_i,clk_i)Beginif(reset_i='1'andreset_i='1')thentimer_cnt<=0;elsif(clk_i'eventandclk_i='1')thenif(load='1'andload='1')thentimer_cnt<=timer_set;elsif(clk_1s='1'andwork='1'andtimer_cnt>0)thentimer_cnt<=timer_cnt-1;endif;endif;Endprocess;timeout<='1'whentimer_cnt=0else'0';PROCESS(reset_i,clk)Variabletmp:integerrange0to50;BEGIN IFreset_i='1'THEN tmp:=0; ELSIFclk'eventANDclk='1'THEN IFtmp=50THEN tmp:=0; ELSE tmp:=tmp+1; ENDIF; IFtmp<50THEN clk_i<='1'; ELSE clk_i<='0'; ENDIF;ENDIF;ENDPROCESS;Process(reset_i,clk_i)Variablei:integerrange0to999999;Beginif(reset_i='1'andreset_i='1')thenclk_1s<='0';i:=0;elsif(clk_i'eventandclk_i='1')thenif(load='1'andload='1')theni:=0;elsif(i=999999)thenclk_1s<='1';i:=0;elseclk_1s<='0';i:=i+1;endif;endif;Endprocess;----------------------------------------------------------------seg7out--------------------------------------------------------------Process(timer_cnt)begincase(timer_cnt)iswhen0|1|2|3|4|5|6|7|8|9=>time_bcd_h<="0000";--數(shù)碼管高位顯示when10|11|12|13|14|15|16|17|18|19=>time_bcd_h<="0001";when20|21|22|23|24|25|26|27|28|29=>time_bcd_h<="0010";when30|31|32|33|34|35|36|37|38|39=>time_bcd_h<="0011";when40|41|42|43|44|45|46|47|48|49=>time_bcd_h<="0100";when50|51|52|53|54|55|56|57|58|59=>time_bcd_h<="0101";when60|61|62|63|64|65|66|67|68|69=>time_bcd_h<="0110";when70|71|72|73|74|75|76|77|78|79=>time_bcd_h<="0111";when80|81|82|83|84|85|86|87|88|89=>time_bcd_h<="1000";when90=>time_bcd_h<="1001";whenothers=>time_bcd_h<="0000";endcase;endprocess;Process(timer_cnt)begincase(timer_cnt)iswhen0|10|20|30|40|50|60|70|80|90=>time_bcd_l<="0000";--數(shù)碼管低位顯示when1|11|21|31|41|51|61|71|81=>time_bcd_l<="0001";when2|12|22|32|42|52|62|72|82=>time_bcd_l<="0010";when3|13|23|33|43|53|63|73|83=>time_bcd_l<="0011";when4|14|24|34|44|54|64|74|84=>time_bcd_l<="0100";when5|15|25|35|45|55|65|75|85=>time_bcd_l<="0101";when6|16|26|36|46|56|66|76|86=>time_bcd_l<="0110";when7|17|27|37|47|57|67|77|87=>time_bcd_l<="0111";when8|18|28|38|48|58|68|78|88=>time_bcd_l<="1000";when9|19|29|39|49|59|69|79|89=>time_bcd_l<="1001";whenothers=>time_bcd_l<="0000";endcase;endprocess;Process(level_cnt)begincase(level_cnt)iswhen0=>level_bcd_3<="0000";level_bcd_2<="0001";level_bcd_1<="0000";level_bcd_0<="0000";--火力顯示when1=>level_bcd_3<="0000";level_bcd_2<="0110";level_bcd_1<="0000";level_bcd_0<="0000";when2=>level_bcd_3<="0001";level_bcd_2<="0001";level_bcd_1<="0000";level_bcd_0<="0000";when3=>level_bcd_3<="0001";level_bcd_2<="0101";level_bcd_1<="0000";level_bcd_0<="0000";when4=>level_bcd_3<="0001";level_bcd_2<="1001";level_bcd_1<="0000";level_bcd_0<="0000";whenothers=>level_bcd_3<="0000";level_bcd_2<="0000";level_bcd_1<="0000";level_bcd_0<="0000";endcase;endprocess;Process(work,clk_i)Beginif(work='0')thenseg_cat<=6;elsif(clk_i'eventandclk_i='1')thenif(seg_cat=5)thenseg_cat<=0;elseseg_cat<=seg_cat+1;endif;endif;Endprocess;Process(seg_cat)begincase(seg_cat)iswhen0=>cat_o<="011111";--數(shù)碼管掃描when1=>cat_o<="101111";when2=>cat_o<="110111";when3=>cat_o<="111011";when4=>cat_o<="111101";when5=>cat_o<="111110";whenothers=>cat_o<="111111";endcase;endprocess;Process(seg_cat)begincase(seg_cat)iswhen0=>seg<=time_bcd_h;--數(shù)碼管的掃描when1=>seg<=time_bcd_l;when2=>seg<=level_bcd_3;when3=>seg<=level_bcd_2;when4=>seg<=level_bcd_1;when5=>seg<=level_bcd_0;whenothers=>seg<="0000";endcase;endprocess;Process(seg)begincase(seg)iswhen"0000"=>seg7_o<="11111100";--數(shù)碼管輸出when"0001"=>seg7_o<="01100000";when"0010"=>seg7_o<="11011010";when"0011"=>seg7_o<="11110010";when"0100"=>seg7_o<="01100110";when"0101"=>seg7_o<="10110110";when"0110"=>seg7_o<="10111110";when"0111"=>seg7_o<="11100000";when"1000"=>seg7_o<="11111110";when"1001"=>seg7_o<="11110110";whenothers=>seg7_o<="00000000";endcase;endprocess;----------------------------------------------------------------dotmatrixout--------------------------------------------------------------Process(mode_cnt)begincase(mode_cnt)iswhen0=>col_0<="01000010";col_1<="01000010";col_2<="01000010";col_3<="01111110";col_4<="01000010";col_5<="01000010";col_6<="01000010";col_7<="00000000";when1=>col_0<="00011000";col_1<="00100100";col_2<="00100000";col_3<="00100000";col_4<="00100000";col_5<="00100000";col_6<="01111100";col_7<="00000000";when2=>col_0<="00111100";col_1<="01000100";col_2<="01000100";col_3<="00111100";col_4<="01000100";col_5<="01000100";col_6<="00111100";col_7<="00000000";when3=>col_0<="00010000";col_1<="00010000";col_2<="00010000";col_3<="00010000";col_4<="00010000";col_5<="00010000";col_6<="11111110";col_7<="00000000";when4=>col_0<="11111111";col_1<="00000010";col_2<="00000100";col_3<="00001000";col_4<="00010000";col_5<="00100000";col_6<="01000000";col_7<="11111111";whenothers=>col_0<=x"00";col_1<=x"00";col_2<=x"00";
溫馨提示
- 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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 新疆維吾爾自治區(qū)喀什地區(qū)巴楚縣2024-2025學(xué)年高一上學(xué)期1月期末測試生物試卷(含答案)
- 陜西省漢中市二中類校2024-2025學(xué)年高一上學(xué)期12月第二次月考物理試卷(含答案)
- 2025年江蘇省南京市、鹽城市二市高考一模試卷-物理(含答案)
- 5計(jì)算題-工程核算(江蘇)
- 化學(xué)-內(nèi)蒙古鄂爾多斯市西四旗2024-2025學(xué)年2025屆高三第一(上)學(xué)期期末聯(lián)考試卷試題和答案
- 2025年度廠長任期目標(biāo)管理與創(chuàng)新激勵合同2篇
- 2024門窗工程材料供應(yīng)與安裝施工總承包合同3篇
- 2024年心理咨詢師題庫參考答案 (一)
- 2024生產(chǎn)車間技術(shù)改造項(xiàng)目承包合同3篇
- 2024雇傭臨時(shí)駕駛員合同
- (完整版)中職數(shù)學(xué)習(xí)題及答案
- GB∕T 41627-2022 動物源空腸彎曲菌檢測方法
- 供貨保障措施
- (完整版)常用樂高零件清單匯總
- 消防四個(gè)能力
- 機(jī)動車環(huán)檢標(biāo)準(zhǔn)方法驗(yàn)證模板
- AQL標(biāo)準(zhǔn)抽樣檢驗(yàn)表
- 美國Control4智能家居設(shè)計(jì)方案解說資料
- DES算法Matlab代碼
- 交通事故快速處理單(正反打印)
- 電纜熱穩(wěn)定校驗(yàn)計(jì)算書
評論
0/150
提交評論