鍵盤掃描與計算器VHDL仿真設計_第1頁
鍵盤掃描與計算器VHDL仿真設計_第2頁
鍵盤掃描與計算器VHDL仿真設計_第3頁
已閱讀5頁,還剩32頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、簡易計算器設計EDA實驗報告實驗內(nèi)容實驗要求:完成個位數(shù)的加減乘運算,輸入用矩陣鍵盤,輸出用數(shù)碼管顯示,每輸入一次數(shù)據(jù)要顯示在數(shù)碼管上。矩陣鍵盤共16個按鍵,用其中10個做個位數(shù)的輸入,用3個分別做加減乘運算,用其中1個做等于操作,各位數(shù)的運算結果最 多兩位,用動態(tài)掃描數(shù)碼管顯示運算結果。二、小組成員三、實現(xiàn)方法系統(tǒng)組成及連接原理如圖所示 ,主要由由七個功能模塊組成 :分頻模塊(為鍵盤掃 描模塊和防抖模塊提供時鐘 )、鍵盤掃描驅(qū)動模塊 (依次置零)、鍵盤按鍵值編碼 模塊、鍵盤編碼值防抖模塊、運算模塊,數(shù)碼管顯示驅(qū)動模塊、動態(tài)掃描驅(qū)動模 塊。數(shù)碼 管顯 4運算動態(tài) 顯示1fI-11分頻模塊由于F

2、PGA實驗板的原始時鐘頻率高達33.8688MHz,所以不能直接接入設計模塊中使用,就需要用到分頻模塊。將33.8688MHz分頻到4KHz和10Hz來使用,一個用于行驅(qū)動掃描時鐘,一個用于防抖模塊。所以,采用寫一個可變分頻元件來調(diào)用。元件視圖:elkclkout_kbclkout_LED主要代碼如下 (完整代碼見附錄,下同):architecture RTL of freq_divisi on iscomp onent frediv n isgen eric (n:positive);Port ( clki n:in STD_LOGIC;clkout:out STD_LOGIC);end c

3、omp onent;beginU1:frediv ngen eric map( n=>3)port map(clk in=>clk,clkout=>clkout_kb);end RTL;仿真結果如下圖:達到預期的目的2.行驅(qū)動模塊(依次對行置零):鍵盤掃描的原理就是檢測行列信號然后判斷出具體是按下了哪一個按鍵。所以,對行依次置零,當置零頻率較快時,按下某一個按鍵后,一定能得到某一列的信號輸出為零,如下圖:keyin上拉電阻孑wrjhmIDwwwCDEkeydrAv*89A_k456*012當行信號為1110時,若按下了 0鍵,就會得到1110的列信號,立馬就快可以譯碼出 按鍵

4、值,若按下4鍵、8鍵、C鍵則都不會有輸出。主要代碼如下:process(clk in)beginif clr='1' the ncou nt<="00"elsif rising_edge(clkin) thenif coun t="11" the ncou nt<="00"else coun t<=co un t+1;end if;end if;end process;process(co unt)beginif cou nt="01" thenkeydrv<="1

5、110"elsif coun t="10" thenkeydrv<="1101"elsif coun t="11" thenkeydrv<="1011"elsif coun t="00" thenkeydrv<="0111"end if;end process;仿真結果如下圖:達到預期的目的3.鍵值編碼模塊依據(jù)行驅(qū)動模塊,當按下某一個按鍵后,立馬可以根據(jù)行列和并位信號得到唯一的鍵盤編碼值,用5位矢量來保存結果,當沒有按鍵按下時,編碼值一直保持著11

6、111不變, 并在后端的模塊中不對其做任何處理。以下列出部分編碼表(完整編碼表見附錄)十進制數(shù)行&列HEX七段碼HEX011101110EE11111107E411011110DE011001133511011101DD10110115B主要代碼如下process(clk)beginif clr='0' thenif risin g_edge(clk) the nif temp仁"11101110" the nkeyvalue1<="00000"-0elsif temp仁"11101101" the nk

7、eyvalue1<="00001"-1elsif temp1="11101011" the nkeyvalue1<="00010"-2elsif temp1="11100111" the nkeyvalue1<="00011"-3elsif temp1="11011110" the nkeyvalue1<="00100"-4elsif temp1="11011101" the nkeyvalue1<=&qu

8、ot;00101"-5elsif temp1="11011011" the nkeyvalue1<="00110"-6elsif temp1="11010111" the nkeyvalue1<="00111"-7elsif temp1="10111110" the nkeyvalue1<="01000"-8elsif temp1="10111101" the nkeyvalue1<="01001"-9

9、elsif temp1="10111011" the nkeyvalue1<="01010"-10elsif temp仁"10110111" the nkeyvalue1<="01011"-11elsif temp仁"01111110" the nkeyvalue1<="01100"-12elsif temp1="01111101" the nkeyvalue1<="01101"-13elsif temp1=&q

10、uot;01111011" the nkeyvalue1<="01110"-14elsif temp1="01110111" the nkeyvalue1<="01111"-15end if;end if;end if;end process;波形仿真如下圖:4防抖模塊鍵盤按鍵物理模型如下通常的按鍵所用開關為機械彈性開關,當機械觸點斷開、閉合時,由于機械觸點的彈性作用,一個按鍵開關在閉合時不會馬上穩(wěn)定地接通,在斷開時也不會一下子斷開。因而在閉合及斷開的瞬間均伴隨有一連串的抖動,為了不產(chǎn)生這種現(xiàn)象而作的措施就是按鍵

11、消抖。抖動時間的長短由按鍵的機械特性決定,一般為5ms10ms。一般來說,軟件消抖的方法是不斷檢測按鍵值,直到按鍵值穩(wěn)定。實現(xiàn)方法:假設未按鍵時輸入1,按鍵后輸入 為0,抖動時不定??梢宰鲆韵聶z測:檢測到按鍵輸入為 0之后,延時5ms10ms ,再次 檢測,如果按鍵還為0,那么就認為有按鍵輸入。延時的5ms10ms恰好避開了抖動 期。本模塊是采用多次采樣來達到防抖的,只有在給定的采樣次數(shù)內(nèi),都保證采樣結果一致時才會輸出按鍵編碼值。主要代碼如下:case count iswhen "0000"=> test1<=temp;when "0001"

12、=> test2<=temp;when "0010"=> test3<=temp;whe n "0011"=> test4<=temp;when "0100"=> test5<=temp; when "0101"=> test6<=temp;when "0110"=> test7<=temp;when "0111"=> test8<=temp;when "1000"=>

13、; test9<=temp;when "1001"=> test10<=temp;when "1010"=> test11<=temp;when "1011"=> test12<=temp;when "1100"=> test13<=temp;when "1101"=> test14<=temp;when "1110"=> test15<=temp;when "1111"=>

14、; test16<=temp;whe n others=>n ull;end case;if test1=test5 and test2=test6 and test3=test7 and test4=test8 and test5=test9 and test6=test10 and test7=test11 and test8=test12 and test9=test13 and test10=test14 and test11=test15 and test12=test16 and testl /= "UUUUUUUU" the n仿真波形如下:從圖中

15、可以看出最終tempi從臨時信號temp得到最終輸出,達到防抖:常護J DJJEIII B113'1! b'i-i£31i|aeF1uu ui I1i15.運算模塊當前段的模塊經(jīng)過防抖處理以后得到穩(wěn)定的按鍵信號,比如1+2=3,轉(zhuǎn)化為編碼值就是11101101 10111011 01111101 11100111 => ED BB EB 7D E7(具體編碼表見附錄 )主要代碼如下:if ysfh=0 the n result<=first+sec ond;elsif ysfh=1 then result<=first-second;elsif ys

16、fh=2 then result<=first*second;end if; n<=n+'1'elsif n="100" the nn<="000"end if;end if;end process;process (n)beginif n=" 001"the n keyvalue in<=con v_stdogic_vector(first,8);elsif n="011"the n keyvalue in<=con v_std_logic_vector(sec on

17、 d,8);elsif n="100"the n keyvalue in<=con v_std_logic_vector(result,8);end if;end process;仿真波形如下以1+3=4 和5x6=30 為例:nr oejiiaiueiii3|1 -L夕;.戸1 Lsie i! " da !i a IE 1 ' £4 afi' 4 1 4* 1汕,弭”'t.£ - * a - > »i4ei-ii4irslart-口 IT縛住阿:DtoOl貳右阿曲同:司習可觀!(F何:IC何心:.

18、莎:忙匠價:陋):耶何陽T側(誠刪二 二ir卿nd"同1耐LTJ廠m"那加図問T啷潮醴d丄D1 Urnr郵曲卩1U 1 11_1L1Ennranr7 W 1rnnx 即 alu 訓70|M骨恫UE l7-nr團詞騎in冋011|編碼:01 + 03 =0405 X 06 =1EIt追怕u"閔w :饋汕測q1"Inr唧創(chuàng)El咂U6.數(shù)碼管顯示模塊以及動態(tài)掃描模塊由于次兩個模塊是密切相關的,所以統(tǒng)一到一起驗證。經(jīng)過運算得到最終的顯示結果后,要在七段數(shù)碼管中顯示,就必須有每一個數(shù)的七段碼,同時,由于前面的運算模塊的結果最大可以達到 81,也就是需要8位二進制,

19、兩位十進制來表示,所以就必須通過顯示模塊來分離出十位和個位。分離出十位和個位以后,就必須要利用動態(tài)掃描使兩個數(shù)都能顯示出來。因為8個七段數(shù)碼管的abcdefg位是連在一起的,只有利用分時間隔來顯示,一次使能一個數(shù)碼管,顯示一位數(shù),當頻率較高時,就可以得到兩位數(shù)的顯示效果 數(shù)碼管顯示模塊主要代碼如下:if num=O the nten:=0;on e:=10;elsif num <10 and num >0the nten:=0;one:=num;elsif num <20 and num>9 the nten :=1;o ne:=nu m-10;elsif num &l

20、t;30 and num >19 the nten:=2; one:=nu m-20;elsif num<40 and num >29 the nten:=3; one:=nu m-30;elsif num <50 and num >39 the nten :=4;o ne:=nu m-40;elsif num <60 and num >49 the nten:=5; one:=nu m-50;elsif num <70 and num >59 the nten :=6;o ne:=nu m-60;elsif num <80 and

21、num >69 the nten:=7; one:=nu m-70;elsif num <90 and num >79 the nten:=8; one:=nu m-80;elsif num <100 and num >89 the n ten:=9; one:=nu m-90;end if;t<=c on v_std_logic_vector(te n,4);o<=c on v_std_logic_vect or(on e,4); 動態(tài)掃描模塊主要代碼如下:if coun t="00" the nshowout<=show1

22、;e n<="00000010"elsif coun t="01" the nshowout<=show2;e n<="00000001" end if;仿真波形如下:數(shù)碼顯示模塊Show1是十位數(shù),show2是個位數(shù),分別為7E(七段碼十六進制)和30,即01 。掃描顯示模塊數(shù)碼管使能信號en依次在01和02中變化,翻譯成八段碼就是00000001和00000010四、模塊調(diào)用將上述模塊按照層次調(diào)用,就可以得到最頂層的文件,完成計算器的所有要求功臺匕 冃匕。調(diào)用圖如下時鐘模塊:分頻頂層文件運算模塊防抖模塊后端 處

23、理掃描顯示數(shù)碼管顯示鍵盤編碼最終的仿真波形如下:01 => showout 0110000 3002 => showout 1101101 6D03 => showout 1111001 79由以上波形可以看出:01 + 02 = 03的計算完成了 。五、總結本次EDA設計實踐,完成了從 VHDL代碼編寫到硬件實現(xiàn)的整個流程,掌握了一些FPGA的相關概念以及ISE軟件和Active-HDL軟件的使用方法。最重要的就是組員之間的 合作,因為VHDL程序是模塊化編寫的,所以不同模塊是由不同人來完成編譯的,要達到各個模塊之間能夠良好的銜接通信,就必須有一個很好的溝通交流,把大家的思

24、路集中起來,一起討論、編寫、調(diào)試程序。附錄一】完整程序:分頻:library IEEE;library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_ARITH.ALL;useuseIEEE.STD_LOGIC_UNSIGNED.ALL;IEEE.STD_LOGIC_UNSIGNED.ALL;en tity frediv n isen tity keysca n isgen eric( n:i nteger:=3);Port

25、 ( clr:in std_logic;clki n : inPort ( elk in:in STD_LOGIC;STD_LOGIC;clkout:outkeydrv :outSTD_LOGIC);STD_LOGIC_VECTOR(3 dow nto 0);end frediv n;end keysca n;architecture behavioral ofarchitectureBehavioralofkeysca n isfrediv n issig nal count : std_logic_vector(1sig nal clk1:std_logic:='0:dow nto

26、 0);sig nal coun ter:i nteger range 0 tobeginn;process(clk in)beginbeginprocess(clk in)if clr='1' thencou nt<="00"beginelsif rising_edge(clkin) thenif risin g_edge(clk in) the nif cou nt="11" the nif counter=(n-1)/2 the ncou nt<="OO"elseclk1<=not clk1;c

27、oun t<=co un t+1;coun ter<=0;end if;end if;elseend process;coun ter<=co un ter+1;process(co unt)end if;beginend if;if cou nt="01" the nend process;keydrv<="1110"clkout<=clk1;elsif cou nt="10" the nend Behavioral;keydrv<="1101"elsif cou nt=&qu

28、ot;11" the nkeydrv<="1011"elsif coun t="00" the nkeydrv<="0111"end if;end process;end behavioral;鍵值編碼:防抖:library IEEE;library IEEE;use IEEE.STD_LOGIC_1164.ALL;useuse IEEE.STD_LOGIC_ARITH.ALL;IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_UNSIGNED.ALL;useen tity k

29、eydecoder isIEEE.STD_LOGIC_ARITH.ALL;Port ( clkin,clk,clr: in std_logic;usekeyi n : in STD_LOGIC_VECTOR (3IEEE.STD_LOGIC_UNSIGNED.ALL;dow nto 0);use ieee .nu meric_std.all;keycode : outSTD_LOGIC_VECTORen tity fan gdou is(4 dow nto 0)port(keycode:i n);std_logic_vector(4 dow nto 0);end keydecoder;keyc

30、ode1:outarchitecture Rtl of keydecoder isstd_logic_vector(4 dow nto 0);sig nal temp:STD_LOGIC_VECTOR (7sta rt:out std_logic;dow nto 0);clk_f,clr:in std_logic);sig nal keydrv1:STD_LOGIC_VECTOR (3end fan gdou;dow nto 0);architecture fan gdou ofsig nal keyvalue1:STD_LOGIC_VECTOR (4fan gdou isdow nto 0)

31、;sig nalsig nal temp1:STD_LOGIC_VECTOR (7coun t1:std_logic_vector(2dow nto 0);dow nto 0);comp onent keysca nsig nalPort ( clkin ,clr: inSTD_LOGIC;key1:std_logic_vector(4 dow nto0);keydrv : outSTD_LOGIC_VECTOR(3sig naldow nto 0);key2:std_logic_vector(4 dow ntoend comp onent;0);comp onent fan dou1sig

32、nalPort ( clk in ,clr: inSTD_LOGIC;key3:std_logic_vector(4 dow ntotemp:in std_logic_vector(70);dow nto 0);sig naltemp1: outSTD_LOGIC_VECTOR(7key4:std_logic_vector(4 dow ntodow nto 0);end comp onent;0);beginsig nalu1: keyscankey5:std_logic_vector(4 dow ntoport0);map(clk in=>clk in, keydrv=>keyd

33、rv1,clr=>csig nallr);key6:std_logic_vector(4 dow ntotemp<=keydrv1 &keyi n;0);u2:fa ndou1sig nalport map(clk in=>clk in ,temp=>temp.key7:std_logic_vector(4 dow ntotemp1=>temp1,clr=>clr);0);process(clk)sig nalbeginkey8:std_logic_vector(4 dow ntoif clr='0' then0);if risin

34、g_edge(clk) the nsig nal start_1:std_logic;if temp仁"11101110"beginthe nkeyvalue1<="00000"process(clk_f)elsif temp1="11101101" the nbeginkeyvalue1<="00001"if clr='1' thenelsif temp仁"11101011"the nkeyvalue1<="00010"key1<=&

35、quot;00000"elsif temp仁"11100111"key2<="00001"the nkeyvalue1<="00011"key3<="00010"elsif temp仁"11011110"the nkey4<="00011"keyvalue1<="00100"elsif temp仁"11011101"key5<="00100"the nkeyvalue1&

36、lt;="00101"key6<="00101"elsif temp仁"11011011"the nkey7<="00110"keyvalue1<="00110"elsif temp仁"11010111"key8<="00111"the nkeyvalue1<="00111"cou nt1<="000"elsif temp仁"10111110"start_1&l

37、t;='1'the nkeyvalue1<="01000"elseelsif temp仁"10111101"if risin g_edge(clk_f)the nthe nkeyvalue1<="01001"if cou nt1="111" thenelsif temp仁"10111011"cou nt1<="000"the nelsekeyvalue1<="01010"coun t1<=co un t1+&#

38、39;1'elsif temp1="10110111" the nend if;keyvalue1<="01011"end if;elsif temp仁"01111110"end if;the ncase count1 iskeyvalue1<="01100"whe nelsif temp仁"01111101""000"=>key1<=keycode;the nwhe nkeyvalue1<="01101""

39、001"=>key2<=keycode;elsif temp1="01111011"whe nthe n"010"=>key3<=keycode;keyvalue1<="01110"whe nelsif temp仁"01110111""011"=>key4<=keycode;the nwhe nkeyvalue1<="01111""100"=>key5<=keycode;end if;w

40、he nend if;"101"=>key6<=keycode;end if;whe nend process;"110"=>key7<=keycode;keycode<=keyvalue1;whe nend rtl;"111"=>key8<=keycode; whe n others =>nu II;end case;if key1=key2 and key2=key3and key3=key4 and key4=key5and key5=key6 and key6=key7and k

41、ey7=key8 andkey1/="UUUUU"the nkeycode1<=key1;start_1<='0' after 5ns;end if;end process;start<=start_1;end fan gdou;運算:數(shù)碼管顯示:library IEEE;library IEEE;use IEEE.STD_LOGIC_1164.ALL;useuse IEEE.STD_LOGIC_ARITH.ALL;IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_UNSIGNED.ALL;use iee

42、e.std_logic_arith.all;use ieee .nu meric_std.all;useen tity yun sua n isieee.std_logic_ un sig ned.all;port(start: in std_logic;en tity shumagua nxia nshi iskeycode1:i n std_logic_vector(4 dow nto 0);port(keyvaluei n:i nkeyvaluei n:out stdo gic_vector(7 dow ntostd_logic_vector(7 dow nto 0);0);clk:in

43、 std_logic;end yun sua n;show1,show2:outarchitecture Behavioral of yun sua n isstd_logic_vector(6 dow nto 0);sig nalfirst,sec on d,result,ysfh:end shumagua nxia nshi ;in teger range 0 to 99;architecturesig naln:stdo gic_vector(2 dow ntoshumagua nxia nshiof0);shumagua nxia nshi isbeginsig nal t:std_l

44、ogic_vector(3process(start,keycode1)dow nto 0);beginsig nal o:std_logic_vector(3if start='1' the ndow nto 0);n<="000"beginelse if n="000" the nprocess(clk)if keycode 1="00001"the nvariable num:integer range 0 tofirst<=1;99;elsif keycode 1="00010"

45、the nvariable ten,one: in teger range 0first<=2;to 15;elsif keycode仁"00011"then first<=3;beginelsif keycode仁"00100"then first<=4;if risin g_edge(clk) the nelsif keycode仁"OO1O1"then first<=5;num :=c onv_in teger(keyvalueelsif keycode仁"00110"then fir

46、st<=6;in);elsif keycode仁"00111"then first<=7;if num=0 the nelsif keycode仁"01000"then first<=8;ten:=0;on e:=10;elsif keycode仁"O1OO1"then first<=9;elsif num <10 and num>0elsif keycode 仁"00000" the nthe n ten:=0;one:=num;first<=0;elsif num &l

47、t;20 and num>9end if;the n ten:=1; one:=nu m-10;n<=n+'1'elsif num <30 and num >19elsif n="001"thenthe n ten:=2; one:=nu m-20;ifkeycode 仁"01010"thenelsif num<40 and num >29ysfh<=0;the n ten:=3; one:=nu m-30;elsif keycode 1="01011"the nelsif n

48、um <50 and num >39ysfh<=1;the n ten:=4;one:=num-40;elsif keycode 1="01100"the nelsif num <60 and num >49ysfh<=2;the n ten:=5; one:=nu m-50;end if;elsif num <70 and num >59n<=n+'1'the n ten:=6; one:=nu m-60;elsif n="010"thenelsif num <80 and n

49、um >69if keycode 1="00001"thenthe n ten:=7; one:=nu m-70;second<=1;elsif num <90 and num >79elsif keycode仁"OOO1O"the nthe n ten:=8; one:=nu m-80;second<=2;elsif num<100 and num>89elsif keycode仁"OOO11"the nthe n ten:=9; one:=nu m-90;sec on d<=3;en

50、d if;elsif keycode仁"OO1OO"the nt<=c on v_stdo gic_vector(te n,4);second<=4;elsif keycode 1="00101"theno<=c on v_std_logic_vect or(on e,4)sec on d<=5;elsif keycode仁"OO11O"the ncase t issecond<=6;whe nelsif keycode仁"OO111"the n"0000"=>

51、;show1<="0000000"sec on d<=7;whe nelsif keycode仁"O1OOO"the n"0001"=>show1<="0110000"sec on d<=8;whe nelsif keycode 1="01001"then"0010"=>show1<="1101101"sec on d<=9;whe nelsif keycode仁"OOOOO"the n&

52、quot;0011"=>show1<="1111001"sec on d<=0;whe nend if;"0100"=>show1<="0110011"n<=n+'1'whe nelsif n="011" and keycode仁"01101""0101"=>show1<="1011011"the n ifysfh=0 the nwhe nresult<=first+sec o

53、nd;"0110"=>show1<="0011111"elsif ysfh=1 the n result<=first-whe nsecond;"0111"=>show1<="1110000"elsif ysfh=2 the nwhe nresult<=first*sec ond;"1000"=>show1<="1111111"end if; n<=n+'1'whe nelsif n="100&q

54、uot; the n"1001"=>show1<="1110011"n<="000"whe nend if;others=>show1<="0000000"end if;end case;end process;case o isprocess (n)whe nbegin"0000"=>show2<="1111110"if n="001"the nwhe nkeyvaluei n<=con v_stdo gi

55、c_vector(first,8)"0001"=>show2<="0110000"whe nelsif n="011"then"0010"=>show2<="1101101"keyvalue in<=con v_std_logic_vector(sec onwhe nd,8); elsif n="100"then"0011"=>show2<="1111001"keyvaluei n<=co

56、n v_std _lo gic_vector(result.whe n8);"0100"=>show2<="0110011"end if;whe nend process;"0101"=>show2<="1011011"end Behavioral;whe n"0110"=>show2<="0011111"whe n"0111"=>show2<="1110000"whe n"10

57、00"=>show2<="1111111"whe n "1001"=>show2<="1110011" whe n others=>show2<="0000000" end case;end if;end process;end shumagua nxia nshi ;動態(tài)顯示:鍵盤:library IEEE;library IEEE;useuse IEEE.STD_LOGIC_1164.ALL;IEEE.STD_LOGIC_1164.all;use IEEE.STD_

58、LOGIC_ARITH.ALL;useuse IEEE.STD_LOGIC_UNSIGNED.ALL;IEEE.STD_LOGIC_UNSIGNen tity keyboard isED.ALL;Port ( clr: in std_logic;useclk : in STD_LOGIC;ieee. nu meric_std.all;keyin : in STD_LOGIC_VECTOR (3 dow ntoen tity0);shaomiaoxia nshi iskeydrv1:out std_logic_vector(3 dow nto 0);port(clk,clr:inkeyvalue

59、 :outSTD_LOGIC_VECTOR(4std_logic;dow nto 0);show1:i nstart:out stdo gic);stdo gic_vector(6end keyboard;dow nto 0);architecture RTL of keyboard isshow2:i ncomp onent keysca nstdo gic_vector(6Port ( clkin ,clr: inSTD_LOGIC;dow nto 0);keydrv : outSTD_LOGIC_VECTOR(3showout:outdow nto 0);stdo gic_vector(

60、6end comp onent;dow nto 0);comp onent keydecoderen: outPort ( clkin,clk,clr:in std_logic;std_logic_vector(7keyi n : inSTD_LOGIC_VECTOR (3 dow ntodow nto 0);0);endkeycode : outSTD_LOGIC_VECTOR (4shaomiaoxia nshi;dow nto 0);architectureend comp onent;shaomiaoxia nshi ofcomp onent fan gdoushaomiaoxia n

61、shi isport(keycode:i n std_logic_vector(4 dow ntosig nal0);coun t:std_logic_vector(1keycode1:out std_logic_vector(4 dow ntodow nto 0);0);beginsta rt:out std_logic;process(clk)clk_f,clr:i n std_logic);beginend comp onent;if clr='1' thencomp onent frediv ncou nt<="OO"gen eric( n:i nteger:=3);elsePort ( clk in:in STD_LOGIC;if clk'eve nt andclkout:out STD_LOGIC);clk='1' the nend comp onent;if cou nt="

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論