課程設計--8位計數器eda課程設計報告_第1頁
已閱讀1頁,還剩20頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、<p><b>  課程設計說明書</b></p><p>  題目 8個LED循環(huán)顯示、計數器的設計 </p><p>  起止日期 2009.12.18-2010.1.4 </p><p>  電子設計自動化設計任務書</p><p>  系(部):電子與通信工程系 專業(yè):電氣工程及其自動化

2、 指導教師:</p><p><b>  目錄</b></p><p>  課程設計目的 ……………………………………………………………… 5</p><p>  課程設計題目……………………………………………………………… 5</p><p>  設計內容…………………………………………………………

3、………… 5</p><p>  3.1 設計思路 ……………………………………………………………… 5</p><p>  3.2 設計步驟 ……………………………………………………………… 5</p><p>  4、程序中各引腳的分配 ……………………………………………………… 12</p><p>  5、程序結

4、構框圖………………………………………………………………… 13</p><p>  6、完整程序 …………………………………………………………………… 14</p><p>  7、課程設計總結……………………………………………………………… 21</p><p>  參考文獻……………………………………………………………………… 22<

5、/p><p><b>  課程設計目的</b></p><p>  系統(tǒng)提供一個50MHZ的時鐘,要求用VHDL語言設計一個8位計數器,同時有一個8位led循環(huán)顯示燈,當燈亮一次,數碼管上就記一次數。通過做此計數器,知道分頻的概念,并且知道如何分頻,同時知道什么是數碼管的動態(tài)顯示,怎么做出數碼管的動態(tài)顯示。</p><p><b>  課

6、程設計題目</b></p><p>  8個LED循環(huán)顯示、計數器的設計。</p><p><b>  設計內容</b></p><p><b>  設計思路:</b></p><p>  由于要設計一個8個led燈循環(huán)顯示的計數器。則重要的設計部分在于讓led燈循環(huán)顯示,同時在顯示的同

7、時數碼管的數加1;要讓led燈亮的同時,數碼管上面的數字加1,則需要在同一個脈沖下完成計數器加一,led等循環(huán)亮一位。</p><p>  由于系統(tǒng)給定的時鐘是50Mhz,顯然數碼管和led燈不能正常工作,這就涉及到要將50mhz頻率分頻,將頻率變小,使計數器和led燈能正常工作;</p><p>  Led燈設計思路:led燈要實現循環(huán)顯示,即第一個燈亮之后,在出現一個上升沿脈沖后,第二

8、個燈亮,第一個燈滅,來一個脈沖移動一個,并實現循環(huán),為了實現循環(huán),設計思路是講來一次脈沖將最高位補到最低位,次最高位變成最高位。</p><p>  數碼管的設計思路:由于數碼管要求是動態(tài)顯示,顯然還要分出一個置位工作掃描頻率,由于人的視覺暫留,頻率應該大于24hz,為了數碼管顯示效果,我分出了1000hz的頻率來掃描8位數碼管的工作。</p><p>  分頻的設計思路:分頻是為了將50

9、mhz的頻率減小,即在50mhz(clk)出現n個上升沿之前另一個clk1不翻轉,而在n個上升沿時翻轉,在2n之前一直保持翻轉后的狀態(tài),到2n時,計數器清零,同時再實現翻轉,這樣就能做出任意較小的頻率實現設計。</p><p><b>  2、設計步驟:</b></p><p>  首先設計分頻計數器,由于要有一個數碼管置位工作掃描頻率,還要有一個實現計數個和led燈

10、循環(huán)顯示的頻率,即分頻要分出兩個不同的頻率:</p><p><b>  分頻程序入下:</b></p><p>  process(clk)</p><p>  variable cout:integer:=0;</p><p><b>  begin </b></p><p&

11、gt;  IF clk'event and clk='1' then</p><p>  cout:=cout+1;</p><p>  if cout<=25000 then clk1<='0';</p><p>  elsif cout<50000 then clk1<='1';&l

12、t;/p><p>  else cout:=0;</p><p><b>  end if; </b></p><p><b>  end if; </b></p><p>  end process; </p><p>  process(clk)</p>&l

13、t;p>  variable cout:integer:=0;</p><p><b>  BEGIN</b></p><p>  IF clk'event and clk='1' then</p><p>  cout:=cout+1;</p><p>  IF cout<=1250

14、000 then clk2<='0';</p><p>  elsif cout<25000000 then clk2<='1';</p><p>  else cout:=0;</p><p><b>  end if; </b></p><p>  在進程中,clk

15、為原始頻率50mhz,以上兩個進程是為了分出2hz頻率和1000hz頻率,其中count是進程中的一個變量,用來出現上升沿脈沖計數。其中clk1是分出來的1000hz;頻率,clk2是分出來的2hz的led燈移動和數碼管計數的頻率;</p><p>  在頻率分出來后,就可以設計led燈的循環(huán)顯示了,led燈循環(huán)顯示的程序如下:</p><p>  process(rst,start,cl

16、k2)</p><p>  variable reg8:std_logic_vector(7 downto 0);</p><p>  variable fg:integer:=1;</p><p><b>  begin</b></p><p>  if rst='1' then</p>

17、<p>  reg8:=(others=>'1');</p><p><b>  fg:=1;</b></p><p>  elsif clk2'event and clk2='1' then</p><p>  if start='1' then</p>

18、<p>  if fg=1 then reg8:="11111110";</p><p><b>  fg:=0;</b></p><p>  else reg8:=reg8(6 downto 0)&reg8(7);</p><p><b>  end if;</b></p>

19、;<p><b>  end if;</b></p><p><b>  end if;</b></p><p>  din8<=reg8;</p><p>  end process;</p><p>  程序中,rst是復位信號,功能是在在出現rst=1是,將led回到最初始

20、狀態(tài),從程序中看是燈全滅掉,當rst=0是,回復循環(huán)顯示;start是一個開始信號,只有start=1是,計數才開始工作;din8是一個八位的二進制數,在硬件上直接和8個led燈連接;fg是設計的一個標志位,目的是為了在開始來第一個脈沖時,使第一個led燈變亮,并將fg賦值為零,來第二個脈沖時,就開始循環(huán);</p><p>  當rst=0并且start=1時,Led的波形圖如下:</p><

21、p>  從圖中看出,在rst為0,start為1時,則led燈的顯示就會出現出現循環(huán)顯示,din由11111110到01111111,之后又回到11111110開始循環(huán);</p><p>  在rst=1是,將會復位,即din=“11111111”,波形如下:</p><p>  從圖中明顯能看出,在rst為1時,本該進行循環(huán)的程序在rst=1時,將使din全部置一了,即實現你rst

22、的功能。</p><p>  在做start的功能時,start的功能是,在rst=0,start=1時,將會做led燈的循環(huán),在rst=0,start=1時,將使其暫停循環(huán)功能,并保持當前狀態(tài)不變,波形圖如下:</p><p>  如圖所示,在start=0時,din就停留在11110111,此二進制數正好十進制是239,一直保持此狀態(tài),在start=1是,則開始循環(huán)的工作。</p

23、><p>  做完以上程序的設計,即要實現數碼管的動態(tài)顯示,首先要做的就是數碼管的動態(tài)顯示,即要不間斷的掃面8個數碼管的工作位,掃描置位程序如下:</p><p>  process(clk1)</p><p><b>  begin</b></p><p>  if clk1'event and clk1='

24、;1' then</p><p>  if wei=7 then wei<="000";</p><p>  else wei<=wei+1;</p><p><b>  end if;</b></p><p><b>  end if;</b></p&

25、gt;<p>  end process;</p><p>  process(wei)</p><p><b>  begin</b></p><p>  case wei is</p><p>  when "000" => selout<="00000001&

26、quot;;</p><p>  when "001" => selout<="00000010";</p><p>  when "010" => selout<="00000100";</p><p>  when "011" =>

27、selout<="00001000";</p><p>  when "100" => selout<="00010000";</p><p>  when "101" => selout<="00100000";</p><p>  w

28、hen "110" => selout<="01000000";</p><p>  when "111" => selout<="10000000";</p><p>  when others=>null;</p><p><b>  end

29、case;</b></p><p>  end process;</p><p>  clk1是分出來的1khz頻率,wei是設置的一個三位二進制數,從000-111,每一個狀態(tài)都是置一個數碼管工作,selout是一個7位二進制數,是個硬件上數碼管的工作位一一對應。</p><p>  在做好置位后,余下的就是數碼管顯示計數的問題了,數碼管顯示的是一個8

30、位十進制的數,功能能實現進位,數碼管計數的程序如下:</p><p>  process(rst,start,clk2)</p><p>  variable ao0:std_logic_vector(3 downto 0);</p><p>  variable ao1:std_logic_vector(3 downto 0);</p><p&

31、gt;  variable ao2:std_logic_vector(3 downto 0);</p><p>  variable ao3:std_logic_vector(3 downto 0);</p><p>  variable ao4:std_logic_vector(3 downto 0);</p><p>  variable ao5:std_log

32、ic_vector(3 downto 0);</p><p>  variable ao6:std_logic_vector(3 downto 0);</p><p>  variable ao7:std_logic_vector(3 downto 0);</p><p><b>  begin</b></p><p>

33、  if rst='1' then </p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others

34、=>'0');</p><p>  ao4:=(others=>'0');</p><p>  ao5:=(others=>'0');</p><p>  ao6:=(others=>'0'); </p><p>  ao7:=(others=>&#

35、39;0');</p><p>  elsif clk2'event and clk2='1' then</p><p>  if start='1' then</p><p>  if ao0<=9 then</p><p>  ao0:=ao0+1;</p><p&

36、gt;<b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 and ao6=9 and ao7=9 then</p><p>  ao0:=(others=>'0');

37、</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0');</p&g

38、t;<p>  ao5:=(others=>'0');</p><p>  ao6:=(others=>'0');</p><p>  ao7:=(others=>'0'); </p><p>  else null;</p><p><b>  end

39、 if; </b></p><p>  if ao0>9 then </p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 and ao6=9 then</p><p>  ao7:=ao7+1;</p><p>  ao0:=(others=>

40、'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0&#

41、39;);</p><p>  ao5:=(others=>'0');</p><p>  ao6:=(others=>'0');</p><p>  else null;</p><p><b>  end if;</b></p><p><b&

42、gt;  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 then </p><p>  ao6:=ao6+1;</p><p>  ao0:=(others=>'0&

43、#39;);</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0');&l

44、t;/p><p>  ao5:=(others=>'0');</p><p>  else null;</p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 the

45、n</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 then</p><p>  ao5:=ao5+1;</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p>

46、<p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0');</p><p>  else null;</p><p><b>  end if;&

47、lt;/b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 then</p><p>  ao4:=ao4+1; </p><p>  ao0:=(

48、others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  else null;<

49、/p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 then</p><p>  ao3:=ao3+1;</p

50、><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  else null;</p><p><b>  en

51、d if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 then</p><p>  ao2:=ao2+1;</p><p>  ao0:=(others=>'0&

52、#39;);</p><p>  ao1:=(others=>'0');</p><p>  else ao1:=ao1+1;</p><p>  ao0:=(others=>'0');</p><p>  end if; </p><p>  end if; &

53、lt;/p><p><b>  end if;</b></p><p><b>  end if;</b></p><p><b>  end if;</b></p><p><b>  co0<=ao0;</b></p><p>

54、;<b>  co1<=ao1;</b></p><p><b>  co2<=ao2;</b></p><p><b>  co3<=ao3;</b></p><p><b>  co4<=ao4;</b></p><p><

55、;b>  co5<=ao5;</b></p><p><b>  co6<=ao6;</b></p><p><b>  co7<=ao7;</b></p><p>  end process;</p><p>  程序中co0-co7是對應數碼管上從低位到高位的

56、十進制數,ao0-ao7是程序中定義的中間變量;程序中的rst是復位信號,start是開始信號,在此的rst和start和led循環(huán)顯示中的rst和start是同一信號,這樣才能讓led燈和數碼管同步工作;</p><p>  計數器的波形顯示如下:</p><p>  由上圖看出,在start=1 并且rst=0時,在出現上升沿時,co0加1,當co0到9時,在下一個上升沿將產生進位,使

57、co1變成1,co0變成0。</p><p>  在rst=1時,將產生復位,致使co0-co7全部置0,由波形可得:</p><p>  顯然,當產生復位信號時,全部置零了,說明程序的設計能達到預先設計的效果。</p><p>  在rst=0,start=0時,根據設計,應該是數碼管的數應該保持現有的狀態(tài)不變,并且在start=1后,應該能繼續(xù)計數,實際波形如下

58、:</p><p>  由圖可以得出,在rst=0 并且start=0是,co1=5,co0=3,之后,在start=1時,繼續(xù)開始了計數,說明實現設計的能滿足設計要求。</p><p>  最后一部分就是做出數碼管顯示十進制數,由于每個數碼管的顯示都基本一樣,就只有選擇數碼管的條件不同,在此只寫出一個數碼管的顯示程序:</p><p>  process(wei,

59、co0,co1,co2,co3,co4,co5,co6,co7)</p><p><b>  begin</b></p><p>  if wei="000" then</p><p>  case co0 is</p><p>  when "0000" => led7s1

60、<="1000000";</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>  when &qu

61、ot;0011" => led7s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010";</

62、p><p>  when "0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" => led7s1<

63、="0000000";</p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;</b></p><p>

64、<b>  end if;</b></p><p>  end process;</p><p>  在wei=“000”時,將執(zhí)行由co0的狀態(tài)來顯示個位上的數,co0-co9對應顯示十進制數上的0-9;led7s1是一個七位二進制數,從低位到高位分別對應數碼管的a,b,c,d,e,f,g管腳;十位,千位,萬位等等的顯示皆如此。</p><p&g

65、t;  四、程序中各引腳的分配如下:</p><p><b>  五、程序結構框圖:</b></p><p>  完整的程序如下:library ieee; </p><p>  use ieee.std_logic_1164.all; </p><p>  use ieee.std_logic_unsigned.all

66、;</p><p>  entity jishu is</p><p>  port(clk,rst,start:in std_logic;</p><p>  din8:out std_logic_vector(7 downto 0);</p><p>  selout:out std_logic_vector(7 downto 0);&l

67、t;/p><p>  led7s1:out std_logic_vector(6 downto 0));</p><p><b>  end;</b></p><p>  architecture one of jishu is</p><p>  signal clk1,clk2:std_logic;</p>

68、<p>  signal wei:std_logic_vector(2 downto 0);</p><p>  signal co0:std_logic_vector(3 downto 0);</p><p>  signal co1:std_logic_vector(3 downto 0);</p><p>  signal co2:std_logi

69、c_vector(3 downto 0);</p><p>  signal co3:std_logic_vector(3 downto 0);</p><p>  signal co4:std_logic_vector(3 downto 0);</p><p>  signal co5:std_logic_vector(3 downto 0);</p>

70、<p>  signal co6:std_logic_vector(3 downto 0);</p><p>  signal co7:std_logic_vector(3 downto 0);</p><p><b>  begin</b></p><p>  process(clk)</p><p> 

71、 variable cout:integer:=0;</p><p><b>  begin </b></p><p>  IF clk'event and clk='1' then</p><p>  cout:=cout+1;</p><p>  if cout<=25000 then

72、clk1<='0';</p><p>  elsif cout<50000 then clk1<='1';</p><p>  else cout:=0;</p><p><b>  end if; </b></p><p><b>  end if; <

73、;/b></p><p>  end process; </p><p>  process(clk)</p><p>  variable cout:integer:=0;</p><p><b>  BEGIN</b></p><p>  IF clk'event and clk

74、='1' then</p><p>  cout:=cout+1;</p><p>  IF cout<=1250000 then clk2<='0';</p><p>  elsif cout<25000000 then clk2<='1';</p><p>  els

75、e cout:=0;</p><p><b>  end if; </b></p><p><b>  end if; </b></p><p>  end process;</p><p>  process(rst,start,clk2)</p><p>  varia

76、ble reg8:std_logic_vector(7 downto 0);</p><p>  variable fg:integer:=1;</p><p><b>  begin</b></p><p>  if rst='1' then</p><p>  reg8:=(others=>&#

77、39;1');</p><p><b>  fg:=1;</b></p><p>  elsif clk2'event and clk2='1' then</p><p>  if start='1' then</p><p>  if fg=1 then reg8:=&

78、quot;11111110";</p><p><b>  fg:=fg-1;</b></p><p>  else reg8:=reg8(6 downto 0)&reg8(7);</p><p><b>  end if;</b></p><p><b>  end i

79、f;</b></p><p><b>  end if;</b></p><p>  din8<=reg8;</p><p>  end process;</p><p>  process(clk1)</p><p><b>  begin</b><

80、/p><p>  if clk1'event and clk1='1' then</p><p>  if wei=7 then wei<="000";</p><p>  else wei<=wei+1;</p><p><b>  end if;</b></p

81、><p><b>  end if;</b></p><p>  end process;</p><p>  process(wei)</p><p><b>  begin</b></p><p>  case wei is</p><p>  whe

82、n "000" => selout<="00000001";</p><p>  when "001" => selout<="00000010";</p><p>  when "010" => selout<="00000100";

83、</p><p>  when "011" => selout<="00001000";</p><p>  when "100" => selout<="00010000";</p><p>  when "101" => selout

84、<="00100000";</p><p>  when "110" => selout<="01000000";</p><p>  when "111" => selout<="10000000";</p><p>  when ot

85、hers=>null;</p><p><b>  end case;</b></p><p>  end process;</p><p>  process(rst,start,clk2)</p><p>  variable ao0:std_logic_vector(3 downto 0);</p>

86、;<p>  variable ao1:std_logic_vector(3 downto 0);</p><p>  variable ao2:std_logic_vector(3 downto 0);</p><p>  variable ao3:std_logic_vector(3 downto 0);</p><p>  variable ao

87、4:std_logic_vector(3 downto 0);</p><p>  variable ao5:std_logic_vector(3 downto 0);</p><p>  variable ao6:std_logic_vector(3 downto 0);</p><p>  variable ao7:std_logic_vector(3 down

88、to 0);</p><p><b>  begin</b></p><p>  if rst='1' then </p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p>&l

89、t;p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0');</p><p>  ao5:=(others=>'0');</p><p> 

90、 ao6:=(others=>'0'); </p><p>  ao7:=(others=>'0');</p><p>  elsif clk2'event and clk2='1' then</p><p>  if start='1' then</p><p&

91、gt;  if ao0<=9 then</p><p>  ao0:=ao0+1;</p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 and

92、 ao6=9 and ao7=9 then</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>

93、'0');</p><p>  ao4:=(others=>'0');</p><p>  ao5:=(others=>'0');</p><p>  ao6:=(others=>'0');</p><p>  ao7:=(others=>'0&#

94、39;); </p><p>  else null;</p><p><b>  end if; </b></p><p>  if ao0>9 then </p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 and ao6=9 then

95、</p><p>  ao7:=ao7+1;</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:

96、=(others=>'0');</p><p>  ao4:=(others=>'0');</p><p>  ao5:=(others=>'0');</p><p>  ao6:=(others=>'0');</p><p>  else null;&l

97、t;/p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 and ao5=9 then </p&

98、gt;<p>  ao6:=ao6+1;</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(other

99、s=>'0');</p><p>  ao4:=(others=>'0');</p><p>  ao5:=(others=>'0');</p><p>  else null;</p><p><b>  end if;</b></p>&

100、lt;p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao3=9 and ao4=9 then</p><p>  ao5:=ao5+1;</p><p>  ao0:=(others=>'

101、;0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><p>  ao3:=(others=>'0');</p><p>  ao4:=(others=>'0')

102、;</p><p>  else null;</p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 and ao2=9 and ao

103、3=9 then</p><p>  ao4:=ao4+1; </p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0');</p><

104、p>  ao3:=(others=>'0');</p><p>  else null;</p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p>&

105、lt;p>  if ao1=9 and ao2=9 then</p><p>  ao3:=ao3+1;</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  ao2:=(others=>'0

106、');</p><p>  else null;</p><p><b>  end if;</b></p><p><b>  end if;</b></p><p>  if ao0>9 then</p><p>  if ao1=9 then</p&

107、gt;<p>  ao2:=ao2+1;</p><p>  ao0:=(others=>'0');</p><p>  ao1:=(others=>'0');</p><p>  else ao1:=ao1+1;</p><p>  ao0:=(others=>'0&#

108、39;);</p><p>  end if; </p><p>  end if; </p><p><b>  end if;</b></p><p><b>  end if;</b></p><p><b>  end if;</b>

109、</p><p><b>  co0<=ao0;</b></p><p><b>  co1<=ao1;</b></p><p><b>  co2<=ao2;</b></p><p><b>  co3<=ao3;</b><

110、/p><p><b>  co4<=ao4;</b></p><p><b>  co5<=ao5;</b></p><p><b>  co6<=ao6;</b></p><p><b>  co7<=ao7;</b></p&g

111、t;<p>  end process;</p><p>  process(wei,co0,co1,co2,co3,co4,co5,co6,co7)</p><p><b>  begin</b></p><p>  if wei="000" then</p><p>  case c

112、o0 is</p><p>  when "0000" => led7s1<="1000000";</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" =>

113、led7s1<="0100100";</p><p>  when "0011" => led7s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  wh

114、en "0101" => led7s1<="0010010";</p><p>  when "0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000"

115、;</p><p>  when "1000" => led7s1<="0000000";</p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p>

116、<p><b>  end case;</b></p><p><b>  end if;</b></p><p>  if wei="001" then</p><p>  case co1 is</p><p>  when "0000" =

117、> led7s1<="1000000";</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>

118、;  when "0011" => led7s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010&

119、quot;;</p><p>  when "0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" =>

120、 led7s1<="0000000";</p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;</b></p>

121、<p><b>  end if;</b></p><p>  if wei="010" then</p><p>  case co2 is</p><p>  when "0000" => led7s1<="1000000";</p><

122、;p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>  when "0011" => led7s1<="011

123、0000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010";</p><p>  when "0110"

124、=> led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" => led7s1<="0000000";</p><p&g

125、t;  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;</b></p><p><b>  end if;</b></p>

126、<p>  if wei="011" then</p><p>  case co3 is</p><p>  when "0000" => led7s1<="1000000";</p><p>  when "0001" => led7s1<=&quo

127、t;1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>  when "0011" => led7s1<="0110000";</p><p>  when "0100&q

128、uot; => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010";</p><p>  when "0110" => led7s1<="0000010";</p>&l

129、t;p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" => led7s1<="0000000";</p><p>  when "1001" => led7s1<="00

130、10000";</p><p>  when others=> null;</p><p><b>  end case;</b></p><p><b>  end if;</b></p><p>  if wei="100" then</p>&

131、lt;p>  case co4 is</p><p>  when "0000" => led7s1<="1000000";</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0

132、010" => led7s1<="0100100";</p><p>  when "0011" => led7s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p>

133、;<p>  when "0101" => led7s1<="0010010";</p><p>  when "0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<=&qu

134、ot;1111000";</p><p>  when "1000" => led7s1<="0000000";</p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=>

135、 null;</p><p><b>  end case;</b></p><p><b>  end if;</b></p><p>  if wei="101" then</p><p>  case co5 is</p><p>  when &q

136、uot;0000" => led7s1<="1000000";</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";<

137、/p><p>  when "0011" => led7s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<

138、;="0010010";</p><p>  when "0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "

139、1000" => led7s1<="0000000";</p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;<

140、/b></p><p><b>  end if;</b></p><p>  if wei="110" then</p><p>  case co6 is</p><p>  when "0000" => led7s1<="1000000"

141、;</p><p>  when "0001" => led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>  when "0011" => led7

142、s1<="0110000";</p><p>  when "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010";</p><p>  when &

143、quot;0110" => led7s1<="0000010";</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" => led7s1<="0000000";<

144、;/p><p>  when "1001" => led7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;</b></p><p><b>  end if;</b

145、></p><p>  if wei="111" then</p><p>  case co7 is</p><p>  when "0000" => led7s1<="1000000";</p><p>  when "0001" =>

146、 led7s1<="1111001";</p><p>  when "0010" => led7s1<="0100100";</p><p>  when "0011" => led7s1<="0110000";</p><p>  w

147、hen "0100" => led7s1<="0011001";</p><p>  when "0101" => led7s1<="0010010";</p><p>  when "0110" => led7s1<="0000010"

148、;;</p><p>  when "0111" => led7s1<="1111000";</p><p>  when "1000" => led7s1<="0000000";</p><p>  when "1001" => led

149、7s1<="0010000";</p><p>  when others=> null;</p><p><b>  end case;</b></p><p><b>  end if; </b></p><p>  end process;</p>

150、<p><b>  end;</b></p><p><b>  六、課程設計總結</b></p><p>  通過本次EDA課程設計,讓我更進一步的熟悉了VHDL語言,了解了其中的語法,同時,在做8個led燈循環(huán)顯示和數碼管的計數顯示的過程中,遇到了很多的困難,但從這些困哪中,我也受益匪淺,有困難才會提高,這樣自己才能學到更多的東西

溫馨提示

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

評論

0/150

提交評論