




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、長(zhǎng) 沙 學(xué) 院課程設(shè)計(jì)說(shuō)明書題目 籃球比賽電子記分牌設(shè)計(jì)目 錄一、課題名稱3二、設(shè)計(jì)內(nèi)容3三、設(shè)計(jì)思路31、整體設(shè)計(jì)思路:32、整體設(shè)計(jì)流程:3四、設(shè)計(jì)說(shuō)明41、設(shè)計(jì)程序42、引腳分配設(shè)置:103、功能描述11五、設(shè)計(jì)心得12六、參考文獻(xiàn)12一、 課題名稱籃球比賽電子記分牌設(shè)計(jì)二、設(shè)計(jì)內(nèi)容設(shè)計(jì)一個(gè)籃球比賽記分牌,使用4位數(shù)碼管顯示倒計(jì)時(shí)的分鐘、秒鐘值;2位數(shù)碼管顯示A方得分;2位數(shù)碼管顯示B方得分;使用LED燈作為上、下半場(chǎng)的標(biāo)志;單次加分值包括1分、2分和3分;半場(chǎng)時(shí)間到輸出3秒的聲光提示;可進(jìn)行比賽暫停、比賽加時(shí)等操作;終場(chǎng)時(shí)間到輸出5秒的聲光提示。三、設(shè)計(jì)思路1、整體設(shè)計(jì)思路:根據(jù)設(shè)計(jì)內(nèi)
2、容,可將設(shè)計(jì)將分為五個(gè)模塊來(lái)設(shè)計(jì):分頻計(jì)數(shù)模塊、時(shí)間模塊、加分模塊、動(dòng)態(tài)掃描顯示模塊、LED燈模塊。2、整體設(shè)計(jì)流程: (1)、分頻計(jì)數(shù)模塊:通過(guò)分頻模塊,將試驗(yàn)箱自帶的50MHZ的頻率分頻得到1MZ以及1HZ的頻率 (2)、時(shí)間模塊:將計(jì)時(shí)器的分鐘、秒鐘,通過(guò)借位的方式設(shè)計(jì)成40分鐘的倒計(jì)時(shí)時(shí)鐘 (3)、加分模塊:通過(guò)撥盤開關(guān)的選擇,輸入A、B隊(duì)的比賽得分 (4)、動(dòng)態(tài)掃面顯示模塊:通過(guò)1MHZ的頻率,將時(shí)間以及A、B隊(duì)的比賽得分同時(shí)掃描顯示在數(shù)碼管上 (5)、LED燈模塊:對(duì)上下場(chǎng)的顯示,以及比賽結(jié)束的燈亮延長(zhǎng)顯示四、設(shè)計(jì)說(shuō)明1、 設(shè)計(jì)程序library ieee;use ieee.std
3、_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隊(duì)加分信號(hào) stop:in std_logic; -比賽暫停led7s_selout:out std_logic_vector(7 downto 0); -
4、數(shù)碼管位選 led7s:out std_logic_vector(6 downto 0); -7 段數(shù)碼顯示管led_up:out std_logic; -上半場(chǎng)亮燈顯示led_down:out std_logic; -下半場(chǎng)亮燈顯示led_h_end:out std_logic; -半場(chǎng)結(jié)束延時(shí)亮燈輸出 led_f_end:out std_logic); -全場(chǎng)結(jié)束延時(shí)亮燈輸出end;architecture one of baseketball isconstant time_m :integer:=9; -時(shí)間分位初始化constant time_s :integer:=59; -時(shí)間秒
5、位初始化signal time_m0:integer range 0 to 9; -分位時(shí)間范圍signal time_s0:integer range 0 to 59; -秒位時(shí)間范圍signal cout_A,cout_B:integer range 0 to 99;- 比分計(jì)數(shù)范圍signal clk0_1,clk0_1M:std_logic; -1HZ1MHZ 信號(hào)signal q0_1:integer range 0 to 24999999; -1HZ 分頻計(jì)數(shù)范圍 signal q0_1M:integer range 0 to 25; -1MHZ 分頻計(jì)數(shù)范圍signal half
6、_end,full_end,add_end:std_logic;- 上下半場(chǎng)結(jié)束信號(hào)signal r,a,b,c,d,e,f,g,h:integer range 0 to 9;-掃描顯示加載信號(hào)signal q1:integer range 0 to 7; -動(dòng)態(tài)掃描顯示信號(hào)范圍signal q_3:integer range 0 to 3; -s半場(chǎng)比賽結(jié)束延時(shí)提示signal q_5:integer range 0 to 5; -全場(chǎng)比賽結(jié)束延時(shí)提示signal q_t_m:integer range 0 to 1; -秒借位 signal q_t_s:integer range 0 to
7、 1; -分借位beginprocess(clk) - 1MHZ 頻率beginif clk'event and clk='1' thenif q0_1M=25 thenq0_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=24999999 thenq0_1<=0;clk0_1<=not clk0
8、_1;elseq0_1<=q0_1+1;end if;end if;end process;process(clk0_1,clk) - 時(shí)間模塊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_m0=0 and time_s0=0 thentime_m0<=time_m;led_
9、up<='0'half_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;if half_end='1' and full_end='0' thentime_s0<=time_s;led_down<='1'if time_m0=0 and time_s0=0 thentime_m0<=time_
10、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-比賽計(jì)時(shí)if add_end='0' thentime_s0<=time_s;if time_m0=0 and time_s0=0
11、 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' thenhalf_end<='0'full_end<='0'add_end<='0'end if;end if;end process;process(add
12、1_A,add2_A,add3_A) -A 對(duì)加分模塊beginif add1_A='1' thencout_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;end process;process(add1_B,add2_B,add3_B) -B對(duì)加分模塊beginif add1_B=
13、'1' thencout_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) beginif clk0_1M'event and clk0_1M='1' thenif q1=7 thenq1<=0
14、;else q1<=q1+1;end if;end if;end process;process(q1,a,b,c,d,e,f,g,h) -動(dòng)態(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<=cout_B rem 10;case q1 iswhen 0 => led7s_selout<="00000001" r<
15、=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<="00010000" r<=e;when 5 => led7s_selout<="00100000" r<=f;wh
16、en 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<="1000000"when 1=>led7s<="1111001"when 2=>led7s<="0100100&q
17、uot;when 3=>led7s<="0110000"when 4=>led7s<="0011001"when 5=>led7s<="0010010"when 6=>led7s<="0000010"when 7=>led7s<="1111000"when 8=>led7s<="0000000"when 9=>led7s<="0010000"when others =>
18、; null;end case;end process;process(clk0_1,half_end,full_end) -上下半場(chǎng)燈亮延時(shí)提示beginif clk0_1'event and clk0_1='1' thenif half_end='1' thenif q_3=3 thenled_h_end<='0'else q_3<=q_3+1;led_h_end<='1'end if;end if;if full_end='1' thenif q_5=5 thenled_f_end&
19、lt;='0'else q_5<=q_5+1;led_f_end<='1'end if;end if;if stop='1' thenq_3<=0;q_5<=0;end if;end if;end process;end;2、 引腳分配設(shè)置:3、 功能描述加載程序至試驗(yàn)箱,打開撥盤開關(guān)1,比賽開始,LED燈1滅,進(jìn)行上半場(chǎng)比賽,8個(gè)數(shù)碼顯示管依次顯示09590000,比賽時(shí)間一共10分鐘,前四位為時(shí)間顯示每一秒減計(jì)數(shù)一次;第五位和第六位為A對(duì)比賽分值,當(dāng)撥動(dòng)撥盤開關(guān)3、4、5時(shí),數(shù)碼管相應(yīng)顯示加1分、2分、3分;第七位和第八位為B對(duì)比賽分值,當(dāng)撥動(dòng)撥盤開關(guān)6、7、8時(shí),數(shù)碼管相應(yīng)顯示加1分、2分、3分;打開把盤開關(guān)2,比賽暫停,恢復(fù)以后比賽繼續(xù)進(jìn)行。當(dāng)上半場(chǎng)結(jié)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 出租車客運(yùn)服務(wù)承包與大數(shù)據(jù)分析協(xié)議
- 生態(tài)農(nóng)業(yè)園區(qū)場(chǎng)地租賃及農(nóng)產(chǎn)品銷售合作協(xié)議
- 車輛運(yùn)輸安全培訓(xùn)與咨詢承包協(xié)議
- 車輛過(guò)戶手續(xù)全權(quán)委托合同樣本
- 特色餐飲廚師定制合同書
- 車輛托管與汽車保險(xiǎn)代理合作協(xié)議
- 車輛維修費(fèi)用賠償與保險(xiǎn)理賠協(xié)議
- 會(huì)說(shuō)話的動(dòng)物課件
- 生命教育主題班會(huì)
- 護(hù)士外出培訓(xùn)
- 聲樂(lè)課說(shuō)課課件
- 學(xué)生托管班管理制度
- 2024年山東夏季高中學(xué)業(yè)水平合格考生物試卷真題(含答案)
- 2025年經(jīng)濟(jì)學(xué)基礎(chǔ)知識(shí)測(cè)試試題及答案
- 統(tǒng)編版小學(xué)語(yǔ)文小升初專題訓(xùn)練:根據(jù)課文內(nèi)容填空(含答案)
- 2025年7月浙江省普通高中學(xué)業(yè)水平考試押題模擬暨選考意向?qū)б須v史學(xué)科試題(原卷版)
- 杭州市公安局濱江區(qū)分局招聘警務(wù)輔助人員筆試真題2024
- (2025)入黨積極分子培訓(xùn)考試試題及答案
- 2025年天津市河西區(qū)中考二模語(yǔ)文試題
- 2025屆高考化學(xué)復(fù)習(xí):必背化學(xué)方程式-有機(jī)化學(xué)
- DB31/ 638-2012鑄鋼件單位產(chǎn)品能源消耗限額
評(píng)論
0/150
提交評(píng)論