EDA籃球比賽電子記分牌設(shè)計_第1頁
EDA籃球比賽電子記分牌設(shè)計_第2頁
EDA籃球比賽電子記分牌設(shè)計_第3頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、長沙學(xué)院課程設(shè)計說明書題目 籃球比賽電子記分牌設(shè)計目 錄一、課題名稱 11二、設(shè)計內(nèi)容11三、設(shè)計思路111、整體設(shè)計思路:112、整體設(shè)計流程: 11四、設(shè)計說明 221、設(shè)計程序 222、引腳分配設(shè)置: 883、功能描述 88五、設(shè)計心得 88六、參考文獻(xiàn) 99一、課題名稱 籃球比賽電子記分牌設(shè)計二、設(shè)計內(nèi)容 設(shè)計一個籃球比賽記分牌,使用 4 位數(shù)碼管顯示倒計時的分鐘、秒鐘值; 2 位數(shù)碼管顯示 A 方得分; 2 位數(shù) 碼管顯示 B 方得分;使用 LED 燈作為上、下半場的標(biāo)志;單次加分值包括1分、2分和 3 分;半場時間到輸出3 秒的聲光提示;可進(jìn)行比賽暫停、比賽加時等操作;終場時間到輸

2、出 5 秒的聲光提示。三、設(shè)計思路1、整體設(shè)計思路: 根據(jù)設(shè)計內(nèi)容,可將設(shè)計將分為五個模塊來設(shè)計:分頻計數(shù)模塊、時間模塊、加分模塊、動態(tài)掃描顯示模 塊、 LED 燈模塊。2、整體設(shè)計流程 :( 1)、分頻計數(shù)模塊:通過分頻模塊,將試驗箱自帶的50MHZ 的頻率分頻得到 1MZ以及 1HZ 的頻率2)、時間模塊:將計時器的分鐘、秒鐘,通過借位的方式設(shè)計成40 分鐘的倒計時時鐘3)、加分模塊:通過撥盤開關(guān)的選擇,輸入A、B 隊的比賽得分4)、動態(tài)掃面顯示模塊:通過 1MHZ 的頻率,將時間以及 A、B 隊的比賽得分同時掃描顯示在數(shù) 碼管上5)、 LED 燈模塊:對上下場的顯示,以及比賽結(jié)束的燈亮延

3、長顯示四、設(shè)計說明1、 設(shè)計程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity baseketball isport(clk:in std_logic;start,addtime,add1_A,add2_A,add3_A,add1_B,add2_B,add3_B:in std_logic;-AB dui jia fen xin hao 比賽開始, A.B 隊加分信號stop:in std_logic;-比賽暫停led7s_se

4、lout:out std_logic_vector(7 downto 0); -數(shù)碼管位選 led7s:out std_logic_vector(6 downto 0);-7 段數(shù)碼顯示管led_up:out std_logic; led_down:out std_logic; led_h_end:out std_logic; led_f_end:out std_logic);-上半場亮燈顯示-下半場亮燈顯示-半場結(jié)束延時亮燈輸出- 全場結(jié)束延時亮燈輸出end;architecture one of baseketball isconstant time_m :integer:=9;-時間分位

5、初始化constant time_s :integer:=59;- 時間秒位初始化signal time_m0:integer range 0 to 9; - 分位時間范圍signal time_s0:integer range 0 to 59; - 秒位時間范圍 signal cout_A,cout_B:integer range 0 to 99;- 比分計數(shù)范圍 signal clk0_1,clk0_1M:std_logic;-1HZ1MHZ 信號signal q0_1:integer range 0 to 24999999;-1HZ 分頻計數(shù)范圍signal q0_1M:integer

6、range 0 to 25;-1MHZ 分頻計數(shù)范圍signal half_end,full_end,add_end:std_logic;- 上下半場結(jié)束信號 signal r,a,b,c,d,e,f,g,h:integer range 0 to 9;- 掃描顯示加載信號 signal q1:integer range 0 to 7;-動態(tài)掃描顯示信號范圍signal q_3:integer range 0 to 3;-s 半場比賽結(jié)束延時提示signal q_5:integer range 0 to 5;-全場比賽結(jié)束延時提示signal q_t_m:integer range 0 to 1

7、; - 秒借位 signal q_t_s:integer range 0 to 1; - 分借位 begin process(clk) - 1MHZ 頻率beginif clk'event and clk='1' thenif q0_1M=25 then q0_1M<=0; clk0_1M<=not clk0_1M;else q0_1M<=q0_1M+1;end if;end if;end process;process(clk) - 1HZ 頻率beginif clk'event and clk='1' thenif q0_1

8、=24999999 thenq0_1<=0; clk0_1<=not clk0_1;elseq0_1<=q0_1+1;end if;end if;end process;process(clk0_1,clk) - 時間模塊 beginif clk0_1'event and clk0_1='1' thenif start='1' thenif half_end='0' and full_end='0' thentime_s0<=time_s; led_up<='1'if time

9、_m0=0 and time_s0=0 thentime_m0<=time_m;led_up<='0'half_end<='1'elsif time_s0=0 then q_t_m<=1; time_m0<=time_m0-q_t_m;elseq_t_s<=1; time_s0<=time_s0-q_t_s; end if;end if;if half_end='1' and full_end='0' thentime_s0<=time_s;led_down<='1&#

10、39;if time_m0=0 and time_s0=0 thentime_m0<=time_m;led_down<='0'full_end<='1'elsif time_s0=0 thenq_t_m<=1; time_m0<=time_m0-q_t_m;elseq_t_s<=1; time_s0<=time_s0-q_t_s; end if;end if;end if;if addtime='1' and full_end='1' then - 比賽計時 if add_end='

11、;0' then time_s0<=time_s;if time_m0=0 and time_s0=0 thentime_m0<=time_m;add_end<='1'elsif time_s0=0 thenq_t_m<=1; time_m0<=time_m0-q_t_m;elseq_t_s<=1; time_s0<=time_s0-q_t_s; end if; end if;end if;if stop='1' then half_end<='0' full_end<='0&

12、#39; add_end<='0'end if;end if;end process; process(add1_A,add2_A,add3_A) beginif add1_A='1' then cout_A<=cout_A+1; end if;if add2_A='1' thencout_A<=cout_A+2; end if;if add3_A='1' thencout_A<=cout_A+3; end if;if stop='1' thencout_A <=0;end if;en

13、d process; process(add1_B,add2_B,add3_B) beginif add1_B='1' then cout_B<=cout_B+1; end if;if add2_B='1' thencout_B<=cout_B+2; end if;if add3_B='1' thencout_B<=cout_B+3; end if;if stop='1' thencout_B <=0;end if;end process;process(clk0_1M,q1)begin-A 對加分模塊-B

14、 對加分模塊if clk0_1M'event and clk0_1M='1' then if q1=7 thenq1<=0;else q1<=q1+1; end if;end if;end process;process(q1,a,b,c,d,e,f,g,h) - 動態(tài)掃描顯示模塊 begina<=time_m0/10; b<=time_m0 rem 10; c<=time_s0/10;d<=time_s0 rem 10; e<=cout_A/10;f<=cout_A rem 10; g<=cout_B/10;h&l

15、t;=cout_B rem 10; case q1 iswhen 0 => led7s_selout<="00000001" r<=a; when 1 => led7s_selout<="00000010" r<=b; when 2 => led7s_selout<="00000100" r<=c; when 3 => led7s_selout<="00001000" r<=d; when 4 => led7s_selout<=&q

16、uot;00010000" r<=e; when 5 => led7s_selout<="00100000" r<=f; when 6 => led7s_selout<="01000000" r<=g; when 7 => led7s_selout<="10000000" r<=h; when others => null;end case;end process; process(r) begincase r iswhen 0=>led7s<=&

17、quot;1000000"when 1=>led7s<="1111001"when 2=>led7s<="0100100"when 3=>led7s<="0110000"when 4=>led7s<="0011001" when 5=>led7s<="0010010"when 6=>led7s<="0000010" when 7=>led7s<="1111000"

18、when 8=>led7s<="0000000"when 9=>led7s<="0010000" when others => null;end case;-上下半場燈亮延時提示end process;process(clk0_1,half_end,full_end) beginif clk0_1'event and clk0_1='1' then if half_end='1' then if q_3=3 then led_h_end<='0'else q_3&

19、lt;=q_3+1; led_h_end<='1'end if;end if;if full_end='1' thenif q_5=5 then led_f_end<='0'else q_5<=q_5+1; led_f_end<='1'end if;end if;if stop='1' then q_3<=0; q_5<=0;end if;end if;end process;end;2、引腳分配設(shè)置:ToLocationI.-'G Bank卜laddl APIN M 1

20、12PIN hJ213«*6dcl2 APIN N314lrf-add2 BPIN M415P:Ni1SPIN P517addtimePIN T10斗8udkPIN J319幣* led 7s|10«led7OPIN L31111PIN L41翟倉 led 7s 2PIMJ4 工1113filled 7s 3PIN H 斗1114-filled 7s WPIN H 1115-filled 7sPIN.L21led zs 6PIN K1|17led 7£setciJtQ1B祂伊 led 7s seloutf0PIN G41led 7s selcuitlPIN G31

21、20干 led口uPIN E2121ELL led 7s_selout "3P'TN_F2122led zs sel«utMPIN F11Z3-led7s selciJt5PIN G2124led 7s_selxziut6PIN G 1125- Ied7s selcijtr7PIN M2126<led downPIN R1Q27*_x- lled_f_endPIN JU 112Sledi er dPIN R 11429led upPIN N15330lAstertPIN M313、功能描述加載程序至試驗箱,打開撥盤開關(guān)1,比賽開始,LED燈1滅,進(jìn)行上半場比賽,8個數(shù)碼顯示管依次顯示09590000,比賽時間一共10分鐘,前四位為時間顯示每一秒減計數(shù)一次;第五位和第六位為A對比賽分值,當(dāng)撥動撥盤開關(guān) 3、4、5時,數(shù)碼管相應(yīng)顯示加 1分、2分、3分;第七位和第八位為 B對比賽分值, 當(dāng)撥動撥盤開關(guān)6、7、8時,數(shù)碼管

溫馨提示

  • 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)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論