


版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、長沙學院課程設計說明書題目 籃球比賽電子記分牌設計目 錄一、課題名稱 11二、設計內容11三、設計思路111、整體設計思路:112、整體設計流程: 11四、設計說明 221、設計程序 222、引腳分配設置: 883、功能描述 88五、設計心得 88六、參考文獻 99一、課題名稱 籃球比賽電子記分牌設計二、設計內容 設計一個籃球比賽記分牌,使用 4 位數碼管顯示倒計時的分鐘、秒鐘值; 2 位數碼管顯示 A 方得分; 2 位數 碼管顯示 B 方得分;使用 LED 燈作為上、下半場的標志;單次加分值包括1分、2分和 3 分;半場時間到輸出3 秒的聲光提示;可進行比賽暫停、比賽加時等操作;終場時間到輸
2、出 5 秒的聲光提示。三、設計思路1、整體設計思路: 根據設計內容,可將設計將分為五個模塊來設計:分頻計數模塊、時間模塊、加分模塊、動態掃描顯示模 塊、 LED 燈模塊。2、整體設計流程 :( 1)、分頻計數模塊:通過分頻模塊,將試驗箱自帶的50MHZ 的頻率分頻得到 1MZ以及 1HZ 的頻率2)、時間模塊:將計時器的分鐘、秒鐘,通過借位的方式設計成40 分鐘的倒計時時鐘3)、加分模塊:通過撥盤開關的選擇,輸入A、B 隊的比賽得分4)、動態掃面顯示模塊:通過 1MHZ 的頻率,將時間以及 A、B 隊的比賽得分同時掃描顯示在數 碼管上5)、 LED 燈模塊:對上下場的顯示,以及比賽結束的燈亮延
3、長顯示四、設計說明1、 設計程序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); -數碼管位選 led7s:out std_logic_vector(6 downto 0);-7 段數碼顯示管led_up:out std_logic; led_down:out std_logic; led_h_end:out std_logic; led_f_end:out std_logic);-上半場亮燈顯示-下半場亮燈顯示-半場結束延時亮燈輸出- 全場結束延時亮燈輸出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;- 比分計數范圍 signal clk0_1,clk0_1M:std_logic;-1HZ1MHZ 信號signal q0_1:integer range 0 to 24999999;-1HZ 分頻計數范圍signal q0_1M:integer
6、range 0 to 25;-1MHZ 分頻計數范圍signal half_end,full_end,add_end:std_logic;- 上下半場結束信號 signal r,a,b,c,d,e,f,g,h:integer range 0 to 9;- 掃描顯示加載信號 signal q1:integer range 0 to 7;-動態掃描顯示信號范圍signal q_3:integer range 0 to 3;-s 半場比賽結束延時提示signal q_5:integer range 0 to 5;-全場比賽結束延時提示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) - 動態掃描顯示模塊 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、引腳分配設置: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、功能描述加載程序至試驗箱,打開撥盤開關1,比賽開始,LED燈1滅,進行上半場比賽,8個數碼顯示管依次顯示09590000,比賽時間一共10分鐘,前四位為時間顯示每一秒減計數一次;第五位和第六位為A對比賽分值,當撥動撥盤開關 3、4、5時,數碼管相應顯示加 1分、2分、3分;第七位和第八位為 B對比賽分值, 當撥動撥盤開關6、7、8時,數碼管
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 家具廠質量管理制度
- 應急處置室管理制度
- 強電室安全管理制度
- 律師兩結合管理制度
- 微生物培訓管理制度
- 心電圖質量管理制度
- 急診科被褥管理制度
- 總承包投資管理制度
- 患標本安全管理制度
- 成品倉收貨管理制度
- 福建省福州市2023?2024學年高一下冊期末考數學試卷附解析
- 2025年宜賓市英語七下期末復習檢測試題含答案
- 項目管理從立項到結項全解析
- 全國導游人員資格考試單科綜合測試卷(科目一:政策與法律法規)
- 2024年中國鐵路成都局集團有限公司招聘考試《鐵路基本常識》真題庫及答案
- 中醫診斷學考點總結
- 生態草場使用權轉讓協議
- 第18課清朝的邊疆治理教學設計-統編版七年級歷史下冊
- 物流實操試題及答案詳解
- 播出設備檢修管理制度
- 提高斜拉索梁端錨固鋼套管軸線定位精度
評論
0/150
提交評論