第一篇:基于VHDL的多功能數字鐘設計報告
基于VHDL的多功能數字鐘
設計報告
021215班 衛時章 02121451
一、設計要求
1、具有以二十四小時制計時、顯示、整點報時、時間設置和鬧鐘的功能。
2、設計精度要求為1秒。
二、設計環境:Quartus II
三、系統功能描述
1、系統輸入:時鐘信號clk采用50MHz;系統狀態及較時、定時轉換的控制信號為k、set,校時復位信號為reset,均由按鍵信號產生。
2、系統輸出:LED顯示輸出;蜂鳴器聲音信號輸出。
3、多功能數字電子鐘系統功能的具體描述如下:
(一)計時:正常工作狀態下,每日按24h計時制計時并顯示,蜂鳴器無聲,逢整點報時。
(二)校時:在計時顯示狀態下,按下“k”鍵,進入“小時”待校準狀態,若此時按下“set”鍵,小時開始校準;之后按下“k”鍵則進入“分”待校準狀態;繼續按下“k”鍵則進入“秒”待復零狀態;再次按下“k”鍵數碼管顯示鬧鐘時間,并進入鬧鐘“小時”待校準狀態;再次按下“k”鍵則進入鬧鐘“分”待校準狀態;若再按下“k”鍵恢復到正常計時顯示狀態。若校時過程中按下“reset”鍵,則系統恢復到正常計數狀態。(1)“小時”校準狀態:在“小時”校準狀態下,顯示“小時”的數碼管以2Hz閃爍,并按下“set”鍵時以2Hz的頻率遞增計數。(2)“分”校準狀態:在“分”校準狀態下,顯示“分”的數碼管以2Hz閃爍,并按下“set”鍵時以2Hz的頻率遞增計數。(3)“秒”校準狀態:在“秒復零”狀態下,顯示“秒”的數碼管以2Hz閃爍,并以1Hz的頻率遞增計數。
(4)鬧鐘“小時”校準狀態:在鬧鐘“小時”校準狀態下,顯示“小時”的數碼管以2Hz閃爍,并按下“set”鍵時以2Hz的頻率遞增計數。
(5)鬧鐘“分”校準狀態:在鬧鐘“分”校準狀態下,顯示“分”的數碼管以2Hz閃爍,并按下“set”鍵時以2Hz的頻率遞增計數。
(三)整點報時:蜂鳴器在“59”分鐘的第“51”、“53”、“55”、“57”秒發頻率為500Hz的低音,在“59”分鐘的第“59”秒發頻率為1000Hz的高音,結束時為整點。
(四)顯示:采用掃描顯示方式驅動4個LED數碼管顯示小時、分,秒由兩組led燈以4位BCD 碼顯示。
(五)鬧鐘:鬧鐘定時時間到,蜂鳴器發出頻率為1000Hz的高音,持續時間為60秒。
四、各個模塊分析說明
1、分頻器模塊(freq.vhd)(1)模塊說明:輸入一個頻率為50MHz的CLK,利用計數器分出 1KHz的q1KHz,500Hz的q500Hz,2Hz的q2Hz和1Hz的q1Hz。(2)源程序: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;
entity freq is
port
(CLK: in std_logic;
--輸入時鐘信號
q1KHz: buffer std_logic;
q500Hz: buffer std_logic;
q2Hz: buffer std_logic;
q1Hz: out std_logic);end freq;
architecture bhv of freq is begin P1KHZ:process(CLK)variable cout:integer:=0;begin
if CLK'event and CLK='1' then
cout:=cout+1;
--每來個時鐘上升沿時cout開始計數 if cout<=25000 then q1KHz<='0';
--當cout<=25000時,q1KHz輸出“0”
elsif cout<50000 then q1KHz<='1';--當25000 else cout:=0; --輸出“1”,完成1KHz頻率輸出 end if; end if;end process; P500HZ:process(q1KHz) --q1KHz作為輸入信號,分出q500Hz variable cout:integer:=0;begin if q1KHz'event and q1KHz='1' then cout:=cout+1;if cout=1 then q500Hz<='0'; --二分頻 elsif cout=2 then cout:=0;q500Hz<='1';end if; end if;end process; P2HZ:process(q500Hz)variable cout:integer:=0;begin if q500Hz'event and q500Hz='1' then cout:=cout+1;if cout<=125 then q2Hz<='0'; elsif cout<250 then q2Hz<='1'; else cout:=0;end if; end if;end process; P1HZ:process(q2Hz)variable cout:integer:=0;begin if q2Hz'event and q2Hz='1' then cout:=cout+1;if cout=1 then q1Hz<='0'; elsif cout=2 then cout:=0;q1Hz<='1';end if; end if;end process;end bhv;(3)模塊圖: 2、控制器模塊(contral.vhd)(1)模塊說明:輸入端口k,set鍵來控制6個狀態,這六個狀態分別是: 顯示計時時間狀態,調計時的時、分、秒的3個狀態,調鬧鈴的時、分的3個狀態,reset鍵是復位鍵,用來回到顯示計時時間的狀態。(2)波形仿真圖: (3)模塊圖: 3、二選一模塊(mux21a.vhd)(1)源程序: library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity mux21a is port(a,b,s:in bit; y:out bit);end entity mux21a; architecture one of mux21a is begin process(a,b,s)begin if s='0' then y<=a; --若s=0,y輸出a,反之輸出b。else y<=b;end if;end process;end architecture one;(2)仿真波形圖: (3)模塊圖: 4、計時模塊 a.秒計時(second.vhd)(1)仿真波形圖: (2)模塊圖: b.分計時(minute.vhd)(1)仿真波形圖: (2)模塊圖: c.小時計時(hour.vhd)(1)仿真波形圖: (2)模塊圖: d.鬧鐘分計時(cntm60b.vhd)(1)仿真波形圖: (2)模塊圖: e.鬧鐘小時計時(cnth24b.vhd)(1)仿真波形圖: (2)模塊圖: 5、鬧鐘比較模塊(compare.vhd)(1)模塊說明:比較正常計數時間與鬧鐘定時時間是否相等,若相等,compout輸出“1”,反之輸出“0”。(2)仿真波形圖: (3)模塊圖: 6、報時模塊(bell.vhd)(1)模塊說明:該模塊既實現了整點報時的功能,又實現了鬧鈴的功能,蜂鳴器通過所選頻率的不同,而發出不同的聲音。(2)仿真波形圖: (3)模塊圖: 7、控制顯示模塊(show_con.vhd)(1)模塊說明:該模塊實現了數碼管既可以顯示正常時間,又可以顯示鬧鐘時間的功能;調時過程的定時閃爍功能也在此模塊中真正實現。(2)源程序: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity show_con is port(th1,tm1,ts1:in std_logic_vector(7 downto 4); th0,tm0,ts0:in std_logic_vector(3 downto 0); bh1,bm1:in std_logic_vector(7 downto 4); bh0,bm0:in std_logic_vector(3 downto 0); sec1,min1,h1: out std_logic_vector(7 downto 4); sec0,min0,h0: out std_logic_vector(3 downto 0); q2Hz,flashs,flashh,flashm,sel_show:in std_logic);end show_con; architecture rtl of show_con is begin process(th1,tm1,ts1,th0,tm0,ts0,bh1,bm1,bh0,bm0,q2Hz,flashs,flashh,flashm,sel_show) begin if sel_show='0'then if(flashh='1'and q2Hz='1')then h1<=“1111”;h0<=“1111”;--顯示小時數碼管以2Hz閃爍 min1<=tm1;min0<=tm0; sec1<=ts1;sec0<=ts0; elsif(flashm='1'and q2Hz='1')then h1<=th1;h0<=th0; min1<=“1111”;min0<=“1111”; sec1<=ts1;sec0<=ts0; elsif(flashs='1'and q2Hz='1')then h1<=th1;h0<=th0; min1<=tm1;min0<=tm0; sec1<=“1111”;sec0<=“1111”; else h1<=th1;h0<=th0; min1<=tm1;min0<=tm0; sec1<=ts1;sec0<=ts0; end if; elsif sel_show='1'then--若sel_show為“1”,數碼管顯示鬧鐘時間 if(flashh='1' and q2Hz='1')then h1<=“1111”;h0<=“1111”; min1<=bm1;min0<=bm0; sec1<=“0000”;sec0<=“0000”; elsif(flashm='1' and q2Hz='1')then h1<=bh1;h0<=bh0; min1<=“1111”;min0<=“1111”; sec1<=“0000”;sec0<=“0000”; else h1<=bh1;h0<=bh0; min1<=bm1;min0<=bm0; sec1<=“0000”;sec0<=“0000”; end if; end if; end process;end rtl;(3)模塊圖: 8、動態掃描顯示模塊(scan_led.vhd)(1)模塊說明:由4組輸入信號和輸出信號進而實現了時鐘時、分的動態顯示。(2)源程序: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity scan_led is port(clk1:in std_logic; h0:in std_logic_vector(3 downto 0); h1:in std_logic_vector(7 downto 4); min0:in std_logic_vector(3 downto 0); min1:in std_logic_vector(7 downto 4); ML:out std_logic_vector(7 downto 0); MH:out std_logic_vector(7 downto 0); HL:out std_logic_vector(7 downto 0); HH:out std_logic_vector(7 downto 0));end scan_led; architecture one of scan_led is signal cnt4:std_logic_vector(1 downto 0);signal a: std_logic_vector(3 downto 0);begin p1:process(clk1)begin if clk1'event and clk1 ='1' then cnt4<=cnt4+1; if cnt4=3 then cnt4<=“00”;end if;end if;end process p1; p2:process(cnt4,h1,h0,min1,min0)begin case cnt4 is --控制數碼管位選 when “00”=>case min0 is when “0000”=>ML<=“11000000”; when “0001”=>ML<=“11111001”; when “0010”=>ML<=“10100100”; when “0011”=>ML<=“10110000”; when “0100”=>ML<=“10011001”; when “0101”=>ML<=“10010010”; when “0110”=>ML<=“10000010”; when “0111”=>ML<=“11111000”; when “1000”=>ML<=“10000000”; when “1001”=>ML<=“10010000”; when others=>NULL; end case;when “01”=>case min1 is when “0000”=>MH<=“11000000”; when “0001”=>MH<=“11111001”; when “0010”=>MH<=“10100100”; when “0011”=>MH<=“10110000”; when “0100”=>MH<=“10011001”; when “0101”=>MH<=“10010010”; when “0110”=>MH<=“10000010”; when “0111”=>MH<=“11111000”; when “1000”=>MH<=“10000000”; when “1001”=>MH<=“10010000”; when others=>NULL; end case;when “10”=>case h0 is when “0000”=>HL<=“11000000”; when “0001”=>HL<=“11111001”; when “0010”=>HL<=“10100100”; when “0011”=>HL<=“10110000”; when “0100”=>HL<=“10011001”; when “0101”=>HL<=“10010010”; when “0110”=>HL<=“10000010”; when “0111”=>HL<=“11111000”; when “1000”=>HL<=“10000000”; when “1001”=>HL<=“10010000”; when others=>NULL; end case;when “11”=>case h1 is when “0000”=>HH<=“11000000”; when “0001”=>HH<=“11111001”; when “0010”=>HH<=“10100100”; when “0011”=>HH<=“10110000”; when “0100”=>HH<=“10011001”; when “0101”=>HH<=“10010010”; when “0110”=>HH<=“10000010”; when “0111”=>HH<=“11111000”; when “1000”=>HH<=“10000000”; when “1001”=>HH<=“10010000”; when others=>NULL; end case;when others =>null;end case;end process p2;end one;(3)模塊圖: 五、端口設定 k:button2,set:button1,reset:button0 ; Bell:SW1 用于開關蜂鳴器; 六、頂層電路圖 七、心得體會 此次的數字鐘設計重在于按鍵的控制和各個模塊代碼的編寫,雖然能把鍵盤接口和各個模塊的代碼編寫出來,并能正常顯示,但對于各個模塊的優化設計還有一定的缺陷和不足,比如對按鍵消抖等細節處并未作出優化。 經過此次數字鐘的設計,我確實從中學到很多的東西。首先,通過VHDL硬件語言的學習,我充分認識到了功能模塊如何用語言實現,讓我初步了解到了一個數字電路用硬件語言設計的方式和設計思想。其次,也讓我深深地體會到實踐的重要性,起初我學VHDL語言的時候,只是學得書本上的知識,經過這次課程設計,通過對模塊的語言實現,對于VHDL語言我有了更深的認識。而且在程序錯誤的發現和改正的過程中,我得到了更多的收獲,也確實讓我進步了不少。再次,當我遇到一些問題的時候,請教老師,和同學們一起討論,令我受益頗多!最后,這個多功能數字電子鐘是自我創造與吸取借鑒共同作用的產物,是自我努力的結果。這讓我對數字電路的設計充滿了信心。雖然課程設計已經結束,但這并不代表著我已經真正掌握了VHDL語言,仍需繼續學習! 課程設計任務書 課程設計名稱學生姓名專業班級設計題目多功能數字鐘設計 一、課程設計目的1、綜合運用EDA技術,獨立完成一個課題的設計,考察運用所學知識,解決實際問題的能力; 2、結合理論知識,考察閱讀參考資料、文獻、手冊的能力; 3、進一步熟悉EDA技術的開發流程,掌握文件編輯、編譯、仿真、下載驗證等環節的實現方法和 應用技巧; 4、鍛煉撰寫研究報告、研究論文的能力; 5、通過本實踐環節,培養科學和嚴謹的工作作風。 二、設計內容、技術條件和要求 l、能進行正常的時、分、秒計時功能,分別由6個數碼顯示24小時、60分鐘的計數器顯示。 2、能利用實驗系統上的按鈕實現“校時”、“校分”功能; (1)按下“SA”鍵時,計時器迅速遞增,并按24小時循環; (2)按下“SB”鍵時,計時器迅速遞增,并按59分鐘循環,并向“時”進位; (3)按下“SC”鍵時,秒清零;抖動的,必須對其消抖處理。 3、能利用揚聲器做整點報時: (1)當計時到達59’50”時開始報時,頻率可為500Hz; 計滿23小時后回零;計滿59分鐘后回零。 (2)到達59’59”時為最后一聲整點報時,整點報時的頻率可定為lKHz。 4定時鬧鐘功能 5、用層次化設計方法設計該電路,用硬件描述語言編寫各個功能模塊。 6、報時功能。報時功能用功能仿真的仿真驗證,可通過觀察有關波形確認電路設計是否正確。 三、時間進度安排 1周:(1)完成設計準備,確定實施方案;(2)完成電路文件的輸入和編譯;(4)完成功能仿真。 2周:(1)完成文件至器件的下載,并進行硬件驗證;(2)撰寫設計說明書。 四、主要參考文獻 (1)譚會生、瞿遂春,《EDA技術綜合應用實例與分析》,西安電子科技大學出版社,2004 (2)曹昕燕、周鳳臣等,《EDA技術實驗與課程設計》,清華大學出版社,2006 指導教師簽字:2012年9月1日 library ieee;use ieee.std_logic_1164.all;entity clock is port(clk1hz:in std_logic;--1hz脈沖--clk100:in std_logic;--100hz脈沖--weekclk:in std_logic;--星期調整脈沖--start_stop:in std_logic;--秒表啟動/停止控制--reset:in std_logic;--秒表復位--adclk:in std_logic;--校時脈沖--setselect:in std_logic;--調整位選擇脈沖--mode:in std_logic;--功能選擇脈沖--showdate:in std_logic;--日期顯示--dis:out std_logic_vector(23 downto 0);--顯示輸出--glisten:out std_logic_vector(5 downto 0);--閃爍指示--weekout:out std_logic_vector(3 downto 0);--星期輸出--qh:out std_logic--整點報時--);end clock;architecture arch of clock is component adjust port(adclk: in std_logic; data_in: out std_logic_vector(7 downto 0));end component;component control port(setclk: in std_logic; setlap: out std_logic_vector(1 downto 0); mode: in std_logic; module: out std_logic_vector(2 downto 0));end component;component weekcounter port(clk: in std_logic; clk2: in std_logic; q: out std_logic_vector(3 downto 0));end component;component stopwatch port(clk: in std_logic; reset: in std_logic; start_stop: in std_logic; centsec: out std_logic_vector(7 downto 0); sec: out std_logic_vector(7 downto 0); min: out std_logic_vector(7 downto 0));end component;component h_m_s_count port(clk: in std_logic; set: in std_logic; setlap: in std_logic_vector(1 downto 0); d:in std_logic_vector(7 downto 0); sec:out std_logic_vector(7 downto 0); min:out std_logic_vector(7 downto 0); hour:out std_logic_vector(7 downto 0); qh:out std_logic; qc: out std_logic);end component;component y_m_d_count port(clk: in std_logic; set: in std_logic; setlap: in std_logic_vector(1 downto 0); data_in: in std_logic_vector(7 downto 0); day: out std_logic_vector(7 downto 0); month: out std_logic_vector(7 downto 0); year: out std_logic_vector(7 downto 0));end component;component display port(module: in std_logic_vector(2 downto 0); showdate:in std_logic; clk:in std_logic; setlap:in std_logic_vector(1 downto 0); watch: in std_logic_vector(23 downto 0); time:in std_logic_vector(23 downto 0); date:in std_logic_vector(23 downto 0); dis: out std_logic_vector(23 downto 0); glisten:out std_logic_vector(5 downto 0));end component;signal data_in,mcentsec,msec,mmin,ssec,smin,shour,sdate,smonth,syear:std_logic_vector(7 downto 0);signal setlap:std_logic_vector(1 downto 0);signal module:std_logic_vector(2 downto 0);signal qc:std_logic;signal watch,time,date:std_logic_vector(23 downto 0);begin u1:adjust port map(adclk,data_in);u2:control port map(setselect,setlap,mode,module);u3:stopwatch port map(clk100,reset,start_stop,mcentsec,msec,mmin);u4:h_m_s_count port map(clk1hz,module(1),setlap,data_in,ssec,smin,shour,qh,qc);u5:y_m_d_count port map(qc,module(2),setlap,data_in,sdate,smonth,syear);u6:display port map(module,showdate,clk1hz,setlap,watch,time,date,dis,glisten);u7:weekcounter port map(qc,weekclk,weekout);watch<=mmin&msec&mcentsec;time<=shour&smin&ssec;date<=syear&smonth&sdate;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity adjust is port(adclk: in std_logic; data_in: out std_logic_vector(7 downto 0));end adjust;architecture arch of adjust is signal temp2,temp1:std_logic_vector(3 downto 0);begin process(adclk)begin if rising_edge(adclk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“1001” and temp1=“1001” then temp1<=“0000”;temp2<=“0000”;end if;end if;data_in<=temp2&temp1;end process;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity control is port(setclk: in std_logic;--調整脈沖-- setlap: out std_logic_vector(1 downto 0);--調整位選擇脈沖-- mode: in std_logic;--功能選擇脈沖-- module: out std_logic_vector(2 downto 0)--功能輸出--);end control;architecture arch of control is signal ssetlap:std_logic_vector(1 downto 0);signal s:std_logic_vector(3 downto 0);begin process(mode,setclk)begin if mode='1'then ssetlap<=“00”;elsif rising_edge(setclk)then if ssetlap=“10”then ssetlap<=“00”;else ssetlap<=ssetlap+'1';end if;end if;end process;setlap<=ssetlap;process(mode)begin if rising_edge(mode)then case s is when“0001”=>s<=“0010”;when“0010”=>s<=“0100”;when“0100”=>s<=“1000”;when“1000”=>s<=“0001”;when others=>s<=“0010”;end case;end if;end process;module<=s(3 downto 1);end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity counter60 is port(clk: in std_logic;--計數脈沖-- clr: in std_logic;--復位-- q: out std_logic_vector(7 downto 0);--計數值-- qc:out std_logic--進位輸出--);end counter60;architecture arch of counter60 is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clr,clk)begin if clr='1'then temp1<=“0000”;temp2<=“0000”;elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“0101” and temp1=“1001” then temp1<=“0000”;temp2<=“0000”;qc<='1';else qc<='0';end if;end if;q<=temp2&temp1;end process;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity counter99 is port(clk: in std_logic;--100vhz計數脈沖-- en: in std_logic;--計數使能-- clr: in std_logic;--復位-- q: out std_logic_vector(7 downto 0);--計數值-- qc: out std_logic--進位--);end counter99; architecture arch of counter99 is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clr,clk)begin if clr='1'then temp1<=“0000”;temp2<=“0000”;elsif rising_edge(clk)then if en='1' then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“1001” and temp1=“1001” then temp1<=“0000”;temp2<=“0000”;qc<='1';else qc<='0';end if;end if;end if;q<=temp2&temp1;end process;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity daycounter is port(clk: in std_logic;--計數脈沖-- set: in std_logic;--調整信號-- day_in: in std_logic_vector(7 downto 0);--調整輸入-- day_out: out std_logic_vector(7 downto 0);--天輸出-- qc: out std_logic;--進位-- day28: in std_logic;--該位為1表示該月為28天-- day29: in std_logic;--該位為1表示該月為29天-- day30: in std_logic;--該位為1表示該月為30天-- day31: in std_logic--該位為1表示該月為31天--);end daycounter;architecture arch of daycounter is signal temp1,temp2:std_logic_vector(3 downto 0);signal days:std_logic_vector(7 downto 0);begin days<=“00101000” when day28='1'else “00101001”when day29='1'else “00110000”when day30='1'else “00110001”when day31='1'else “00000000”;process(clk,set,day_in,days)begin if set='1' then temp2<=day_in(7 downto 4);temp1<=day_in(3 downto 0);elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2&temp1=days then temp2<=“0000”;temp1<=“0001”;qc<='1';else qc<='0';end if;end if;end process;day_out<=temp2&temp1;end arch;library ieee;use ieee.std_logic_1164.all;entity days_control is port(month: in std_logic_vector(7 downto 0);--月份-- year2: in std_logic;--年份高位數字bcd碼最低位-- year1: in std_logic_vector(1 downto 0);--年份低位數字bcd碼末兩位-- day28: out std_logic;--該位為1表示該月為28天--day29: out std_logic;--該位為1表示該月為29天-- day30: out std_logic;--該位為1表示該月為30天-- day31: out std_logic--該位為1表示該月為31天--);end days_control;architecture arch of days_control is begin process(month,year2,year1)begin case month is when “00000001”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00000010”=>if(year2='0'and year1=“00”)or(year2='1'and year1=“10”)then day28<='0';day29<='1';day30<='0';day31<='0'; else day28<='1';day29<='0';day30<='0';day31<='0'; end if;when “00000011”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00000100”=>day28<='0';day29<='0';day30<='1';day31<='0';when “00000101”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00000110”=>day28<='0';day29<='0';day30<='1';day31<='0';when “00000111”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00001000”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00001001”=>day28<='0';day29<='0';day30<='1';day31<='0';when “00010000”=>day28<='0';day29<='0';day30<='0';day31<='1';when “00010001”=>day28<='0';day29<='0';day30<='1';day31<='0';when “00010010”=>day28<='0';day29<='0';day30<='0';day31<='1';when others=>day28<='0';day29<='0';day30<='0';day31<='1';end case;end process;end arch;library ieee;use ieee.std_logic_1164.all;entity display is port(module: in std_logic_vector(2 downto 0);--功能選擇-- showdate:in std_logic;--顯示日期-- clk:in std_logic;--閃爍脈沖-- setlap:in std_logic_vector(1 downto 0);--閃爍位選擇-- watch: in std_logic_vector(23 downto 0);--秒表計數值輸入-- time:in std_logic_vector(23 downto 0);--時分秒計數值輸入--date:in std_logic_vector(23 downto 0);--年月日計數值輸入-- dis: out std_logic_vector(23 downto 0);--顯示輸出-- glisten:out std_logic_vector(5 downto 0)--閃爍輸出--);end display;architecture arch of display is begin process(module,showdate,watch,time,date)begin if showdate='1'then dis<=date;else case module is when“001”=>dis<=watch;when“010”=>dis<=time;when“100”=>dis<=date;when others=>dis<=time;end case;end if;end process;process(clk,module,setlap)begin if module=“010”or module=“100”then case setlap is when“00”=>glisten(1 downto 0)<=clk&clk; glisten(5 downto 2)<=“0000”;when“01”=>glisten(3 downto 2)<=clk&clk; glisten(5 downto 4)<=“00”; glisten(1 downto 0)<=“00”;when“10”=>glisten(5 downto 4)<=clk&clk; glisten(3 downto 0)<=“0000”;when others=>glisten<=“000000”;end case;else glisten<=“000000”;end if;end process;end arch;library ieee;use ieee.std_logic_1164.all;entity dmux is port(set:in std_logic;--調整信號-- setlap: in std_logic_vector(1 downto 0);--調整位選擇-- d: in std_logic_vector(7 downto 0);--調整輸入-- set1:out std_logic; set2:out std_logic; set3:out std_logic; q1: out std_logic_vector(7 downto 0); q2: out std_logic_vector(7 downto 0); q3: out std_logic_vector(7 downto 0));end dmux;architecture arch of dmux is begin process(set,setlap,d)begin if set='1' then case setlap is when“00”=>set1<='1';set2<='0';set3<='0'; q1<=d;when“01”=>set1<='0';set2<='1';set3<='0'; q2<=d;when“10”=>set1<='0';set2<='0';set3<='1'; q3<=d;when others=>set1<='0';set2<='0';set3<='0';end case;else set1<='0';set2<='0';set3<='0';end if;end process;end arch;library ieee;use ieee.std_logic_1164.all;entity h_m_s_count is port(clk: in std_logic;--1hz脈沖-- set: in std_logic;--調整信號-- setlap: in std_logic_vector(1 downto 0);--調整位選擇-- d:in std_logic_vector(7 downto 0);--調整輸入-- sec:out std_logic_vector(7 downto 0);--秒輸出-- min:out std_logic_vector(7 downto 0);--分輸出-- hour:out std_logic_vector(7 downto 0);--小時輸出-- qh:out std_logic;--整點報時-- qc: out std_logic--進位--);end h_m_s_count;architecture arch of h_m_s_count is component sec_mincounter port(clk: in std_logic; set:in std_logic; d:in std_logic_vector(7 downto 0); q:out std_logic_vector(7 downto 0); qc:out std_logic);end component;component hourcounter port(clk: in std_logic; set:in std_logic; d:in std_logic_vector(7 downto 0); q: out std_logic_vector(7 downto 0); qc:out std_logic);end component;component dmux port(set:in std_logic; setlap: in std_logic_vector(1 downto 0); d: in std_logic_vector(7 downto 0); set1:out std_logic; set2:out std_logic; set3:out std_logic; q1: out std_logic_vector(7 downto 0); q2: out std_logic_vector(7 downto 0); q3: out std_logic_vector(7 downto 0));end component;signal secset,minset,hourset: std_logic;signal secin,minin,hourin:std_logic_vector(7 downto 0);signal qcsec,qcmin,qchour: std_logic;begin u1:dmux port map(set,setlap,d,secset,minset,hourset,secin,minin,hourin);u2:sec_mincounter port map(clk,secset,secin,sec,qcsec);u3:sec_mincounter port map(qcsec,minset,minin,min,qcmin);u4:hourcounter port map(qcmin,hourset,hourin,hour,qchour);qh<=qcmin;qc<=qchour;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity hourcounter is port(clk: in std_logic;--計數脈沖-- set:in std_logic;--調整信號-- d:in std_logic_vector(7 downto 0);--調整時間-- q: out std_logic_vector(7 downto 0);--小時輸出-- qc:out std_logic--進位--);end hourcounter;architecture arch of hourcounter is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clk,set)begin if set='1'then temp2<=d(7 downto 4);temp1<=d(3 downto 0);elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“0010” and temp1=“0100” then temp1<=“0000”;temp2<=“0000”;qc<='1';else qc<='0';end if;end if;end process;q<=temp2&temp1;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity monthcounter is port(clk: in std_logic;--計數脈沖-- set: in std_logic;--調整信號-- month_in: in std_logic_vector(7 downto 0);--調整輸入-- month_out: out std_logic_vector(7 downto 0);--月輸出-- qc: out std_logic--進位--);end monthcounter;architecture arch of monthcounter is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clk,set,month_in)begin if set='1' then temp2<=month_in(7 downto 4);temp1<=month_in(3 downto 0);elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“0001”and temp1=“0010” then temp2<=“0000”;temp1<=“0001”;qc<='1';else qc<='0';end if;end if;end process;month_out<=temp2&temp1;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity sec_mincounter is port(clk: in std_logic;--計數脈沖-- set:in std_logic;--調整信號-- d:in std_logic_vector(7 downto 0);--調整時間輸入-- q:out std_logic_vector(7 downto 0);--分和秒輸出-- qc:out std_logic--進位--);end sec_mincounter;architecture arch of sec_mincounter is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clk,set)begin if set='1'then temp2<=d(7 downto 4);temp1<=d(3 downto 0);elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“0101” and temp1=“1001” then temp1<=“0000”;temp2<=“0000”;qc<='1';else qc<='0';end if;end if;end process;q<=temp2&temp1;end arch;library ieee;use ieee.std_logic_1164.all;entity stopwatch is port(clk: in std_logic;--100hz脈沖-- reset: in std_logic;--復位-- start_stop: in std_logic;--啟動/停止-- centsec: out std_logic_vector(7 downto 0);--百分秒輸出,當超過60分轉為秒-- sec: out std_logic_vector(7 downto 0);--秒輸出,當超過60分轉為分-- min: out std_logic_vector(7 downto 0)--分輸出,當超過60分轉為小時--);end stopwatch;architecture arch of stopwatch is component counter99 port(clk: in std_logic; en: in std_logic; clr: in std_logic; q: out std_logic_vector(7 downto 0); qc: out std_logic);end component;component counter60 port(clk: in std_logic; clr: in std_logic; q: out std_logic_vector(7 downto 0); qc: out std_logic);end component;signal qc1,qc2,qc3,qc4,flag:std_logic;signal tcentsec,tsec,tmin,thour:std_logic_vector(7 downto 0);begin u1:counter99 port map(clk,start_stop,reset,tcentsec,qc1);u2:counter60 port map(qc1,reset,tsec,qc2);u3:counter60 port map(qc2,reset,tmin,qc3);u4:counter60 port map(qc3,reset,thour,qc4);process(qc3)begin if rising_edge(qc3)then flag<='1';end if;if flag='1' then centsec<=tsec;sec<=tmin;min<=thour;else centsec<=tcentsec;sec<=tsec;min<=tmin;end if;end process;end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity weekcounter is port(clk: in std_logic;--天脈沖-- clk2: in std_logic;--外部星期調整脈沖-- q: out std_logic_vector(3 downto 0)--星期輸出--);end weekcounter;architecture arch of weekcounter is signal temp:std_logic_vector(3 downto 0);signal cp:std_logic;begin cp<=clk or clk2;process begin wait until rising_edge(cp);if temp=“0111” then temp<=“0001”;else temp<=temp+'1';end if;q<=temp;end process;end arch;library ieee;use ieee.std_logic_1164.all;entity y_m_d_count is port(clk: in std_logic;--計數脈沖-- set: in std_logic;--調整信號-- setlap: in std_logic_vector(1 downto 0);--調整位選擇-- data_in: in std_logic_vector(7 downto 0);--調整輸入-- day: out std_logic_vector(7 downto 0);--日輸出-- month: out std_logic_vector(7 downto 0);--月輸出-- year: out std_logic_vector(7 downto 0)--年輸出--);end y_m_d_count;architecture arch of y_m_d_count is component daycounter port(clk: in std_logic; set: in std_logic; day_in: in std_logic_vector(7 downto 0); day_out: out std_logic_vector(7 downto 0); qc: out std_logic; day28: in std_logic; day29: in std_logic; day30: in std_logic; day31: in std_logic);end component;component monthcounter port(clk: in std_logic; set: in std_logic; month_in: in std_logic_vector(7 downto 0); month_out: out std_logic_vector(7 downto 0); qc: out std_logic);end component;component yearcounter port(clk: in std_logic; set: in std_logic; year_in: in std_logic_vector(7 downto 0); year_out: out std_logic_vector(7 downto 0));end component;component dmux port(set:in std_logic; setlap: in std_logic_vector(1 downto 0); d: in std_logic_vector(7 downto 0); set1:out std_logic; set2:out std_logic; set3:out std_logic; q1: out std_logic_vector(7 downto 0); q2: out std_logic_vector(7 downto 0); q3: out std_logic_vector(7 downto 0));end component;component days_control port(month: in std_logic_vector(7 downto 0); year2: in std_logic; year1: in std_logic_vector(1 downto 0); day28: out std_logic; day29: out std_logic; day30: out std_logic; day31: out std_logic);end component;signal dayset,monthset,yearset: std_logic;signal qcday,qcmonth: std_logic;signal dayin,monthin,yearin: std_logic_vector(7 downto 0);signal smonth,syear:std_logic_vector(7 downto 0);signal day28,day29,day30,day31:std_logic;begin u1:dmux port map(set,setlap,data_in,dayset,monthset,yearset,dayin,monthin,yearin);u2:daycounter port map(clk,dayset,dayin,day,qcday,day28,day29,day30,day31);u3:monthcounter port map(qcday,monthset,monthin,smonth,qcmonth);u4:yearcounter port map(qcmonth,yearset,yearin,syear);u8:days_control port map(smonth,syear(4),syear(1 downto 0),day28,day29,day30,day31);month<=smonth;year<=syear; end arch;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity yearcounter is port(clk: in std_logic;--計數脈沖-- set: in std_logic;--調整信號-- year_in: in std_logic_vector(7 downto 0);--調整輸入-- year_out: out std_logic_vector(7 downto 0)--年輸出--);end yearcounter;architecture arch of yearcounter is signal temp1,temp2:std_logic_vector(3 downto 0);begin process(clk,set,year_in)begin if set='1' then temp2<=year_in(7 downto 4);temp1<=year_in(3 downto 0);elsif rising_edge(clk)then if temp1=“1001” then temp2<=temp2+'1';temp1<=“0000”;else temp1<=temp1+'1';end if;if temp2=“1001” and temp1=“1001” then temp1<=“0000”;temp2<=“0000”;end if;end if;end process;year_out<=temp2&temp1;end arch; 課題名稱 姓名 學號 院、系、部 專業 指導教師 電子技術課程設計報告書 2016年6月12日 一、設計任務及要求: 用中小規模集成芯片設計并制作多功能數字鐘,具體要求如下: 1、準確及時,以數字形式顯示時(00~23)、分(00~59)、秒(00~59)的時間。 2、具有校時功能。指導教師簽名: 2016 二、指導教師評語: 指導教師簽名: 2016 三、成績 指導教師簽名: 2016年6月年6月年6月日 日 日 多功能數字鐘課程設計報告 設計目的 一、設計原理與技術方法: 包括:電路工作原理分析與原理圖、元器件選擇與參數計算、電路調試方法與結果說明; 軟件設計說明書與流程圖、軟件源程序代碼、軟件調試方法與運行結果說明。 1、電路工作原理分析與原理圖 數字鐘實際上是一個對標準頻率(1Hz)進行計數的計數電路。由于標準的1Hz 時間信號必須做到準確穩定,所以通常使用輸出頻率穩定的石英晶體振蕩器電路構成數字鐘的振源。又由于計數的起始時間不可能與標準時間(如北京時間)一致,故需要在電路上加一個校時電路。因此一個具有計時、校時、報時、顯示等基本功能的數字鐘主要由振蕩器、分頻器、計數器、譯碼器、顯示器、校時電路、報時電路等七部分組成。石英晶體振蕩器產生的信號經過分頻器得到秒脈沖后,秒脈沖送入計數器計數,計數結果通過“時”、“分”、“秒”譯碼器譯碼,并通過顯示器顯示時間。由以上分析可得到原理框圖如下圖 圖1 實驗原理框圖 2、元器件選擇與參數計算 (1)晶體振蕩電路:產生秒脈沖既可以采用555脈沖發生電路也可以采用晶振脈沖發生電路。若由集成電路定時器555與RC組成的多諧振蕩器作為時間標準信號源,可使555與RC組成多諧振蕩器,產生頻率 f=1kHz的方波信號,再通過分頻則可得到秒脈沖信號。晶體振蕩器電路則可以給數字鐘提供一個頻率穩定準確的32768Hz的方波信號,可保證數字鐘的走時準確及穩定。相比二者的穩定性,晶振電路比555電路能夠產生更加穩定的脈沖,數字電路中的時鐘是由振蕩器產生的,振蕩器是數字鐘的核心。振蕩器的穩定度及頻率的精度決定了數字鐘計時的準確程度,所以最后決定采用晶振脈沖發生電路。石英晶體振蕩器的特點是振蕩頻率準確、電路結構簡單、頻率易調整,它是電子鐘的核心,用它產生標準頻率信號,再由分頻器分成秒時間脈沖。 所以秒脈沖晶體振蕩選用32768Hz的晶振,該元件專為數字鐘電路而設計,其頻率較低,有利于減少分頻器級數。從有關手冊中,可查得C1、C2均為20pF。當要求頻率準確度和穩定度更高時,還可接入校正電容并采取溫度補償措施。由于CMOS電路的輸入阻抗極高,因此反饋電阻R1可選為20MΩ。 (2)分頻器電路:分頻器電路將32768Hz的高頻方波信號經32768(152)次分頻后得到1Hz的方波信號供秒計數器進行計數。分頻器實際上也就是計數器。該電路可通過CD4060與雙D觸發器74LS74共同實現。 (3)時間計數器電路:時間計數電路由秒個位和秒十位計數器、分個位和分十位計數器及時個位和時十位計數器電路構成,其中秒個位和秒十位計數器、分個位和分十位計數器為60進制計數器,而根據設計要求,時個位和時十位計數器為24進制計數器。計數器可以使用十進制的74LS160。 (4)譯碼驅動電路:譯碼驅動電路將計數器輸出的8421BCD碼轉換為數碼管需要的邏輯狀態,并且為保證數碼管正常工作提供足夠的工作電流。譯碼器可以使用CD4511。 (5)校時電路:可以通過基本的門器件、電阻與開關實現。由設計的電路圖可選擇與非門74LS00。(6)整點報時電路:一般時鐘都應具備整點報時電路功能,即在時間出現整點前數秒內,數字鐘會自動報時,以示提醒.其作用方式是發出連續的或有節奏的音頻聲波。 3、電路調試方法與結果說明(1)電路調試方法 ①數碼管的調試:可以用萬用表的負極接數碼管的3或8腳,正極依次接數碼管剩余的管腳所接電阻的另一端,并將萬用表調至測發光二極管檔位,從而測試數碼管的顯示是否正確。②“時”“分”“秒”電路的調試:將“時”“分”“秒”電路連接完成后,可以用函數信號發生器產生的1Hz方波信號分別作為“時”、“分”、“秒”的個位74LS160的計數脈沖,從而測試“時”是否為24進制,“分”和“秒”是否為60進制。③校時電路的調試:先將電路外接用函數信號發生器產生的2Hz方波信號,再分別通過校時、校分電路開關的斷開、閉合以及開關閉合后電路的工作情況判斷電路的校時、校分功能是否正確。 ④秒脈沖產生電路的調試:將電路產生的秒時間脈沖接入示波器,觀察并計算電路是否產生1Hz方波信號。(2)結果說明 ①數碼管的調試:當正極依次接1、2、4、5、7、9、10管腳時,數碼管依次是G、F、A、B、C、D、E亮。②“時”“分”“秒”電路的調試:“時”為24進制(從“00”到“23”),“分”和“秒”都為60進制(從“00”到“59”)。 ③校時電路的調試:開關斷開時電路處于正常工作狀態,開關閉合時電路處于校時、校分狀態。 ④秒脈沖產生電路的調試:電路產生1Hz方波信號。 4、軟件設計說明書與流程圖(1)秒脈沖產生電路 晶體振蕩器是構成數字式時鐘的核心,它保證了時鐘的走時準確及穩定。由于晶體具有較高的頻率穩定性及準確性,從而保證了輸出頻率的穩定和準確。晶體XTAL的頻率選為32768HZ。該元件專為數字鐘電路而設計,其頻率較低,有利于減少分頻器級數。從有關手冊中,可查得C1、C2均為20pF。當要求頻率準確度和穩定度更高時,還可接入校正電容并采取溫度補償措施。由于CMOS電路的輸入阻抗極高,因此反饋電阻R1可選為22MΩ。較高的反饋電阻有利于提高振蕩頻率的穩定性。通常,數字鐘的晶體振蕩器輸出頻率較高,為了得到1Hz的秒信號輸入,需要對振蕩器的輸出信號進行分頻。通常實現分頻器的電路是計數器電路,一般采用多級2進制計數器來實現。 本實驗中采用CD4060來構成分頻電路。管腳圖見圖2。CD4060在數字集成電路中可實現的分頻次數最高,而且CD4060還包含振蕩電路所需的非門,使用更為方便。CD4060計數為14級2進制計數器,可以將32768Hz的信號分頻為2Hz,再經過74LS74即可獲得1Hz的方波信號。原理電路圖如圖3所示,圖4為仿真電路圖。 圖2 D4060管腳圖 圖3 CD4060秒脈沖振蕩發生器 圖 4 產生1Hz時間脈沖的電路圖 (2)時間計數器電路 ①“秒”“分”電路 根據題目要求,“秒”和“分”都是60進制的,而且是從“00”到“59”,可以使用十進制的74LS160來實現這個功能。首先將兩片74LS160通過串行進位方式接成百進制計數器,即分別將“秒”和“分”個位的進位輸出信號經非門作為“秒”和“分”十位的計數輸入脈沖。當計數器從全0狀態開始計數,計入59個脈沖時,經與非門譯碼產生低電平信號立刻將兩片74LS160同時置零,于是便得到了60進制的計數器。74160的邏輯功能示意圖、引腳圖及功能表如下所示。 圖5 a)74160邏輯功能示意圖 b)74160引腳圖 圖6 74160邏輯功能表 ②“時”電路 根據題目要求,“時”是24進制的,而且是從“00”到“23”,可以使用十進制的74LS160來實現這個功能。首先將兩片74LS160通過串行進位方式接成百進制計數器,當計數器從全0狀態開始計數,計入23個脈沖時,經與非門譯碼產生低電平信號立刻將兩片74LS160同時置零,于是便得到了24進制的計數器。(3)譯碼驅動電路 計數器實現了對時間的累計以8421BCD碼形式輸出,選用顯示譯碼電路將計數器的輸出數碼轉換為數碼顯示器件所需要的輸出邏輯和一定的電流,選用CD4511作為顯示譯碼電路,選用LED數碼管作為顯示單元電路。由于CD4511是輸出高電平有效,所以選用七段共陰極LED數碼管。若將“秒”、“分”、“時”計數器的每位輸出分別接到相應七段譯碼器的輸入端,便可進行不同數字的顯示。“秒”用數碼管顯示如圖7所示。 圖7 “秒”的譯碼及驅動顯示電路圖(4)校時電路 數字種啟動后,每當數字鐘顯示與實際時間不符合,需要根據標準時間進行校時。通常,校正時間的方法是:首先截斷正常的計數通路,然后再進行人工觸發計數或將頻率較高的方波信號加到需要校正的計數單元的輸入端,校正好后,再轉入正常計時狀態即可。校“秒”時,采用等待校時。校“分”、“時”的原理比較簡單,采用加速校時。對校時電路的要求是 : 1.在小時校正時不影響分和秒的正常計數。2.在分校正時不影響秒和小時的正常計數。當開關斷開時,因為校正信號和0相與的輸出為0,而開關的另一端接高電平,正常輸入信號可以順利通過與或門,故校時電路處于正常計時狀態;當開關閉合時,情況正好與上述相反,這時校時電路處于校時狀態。與非門可選74LS00,非門則可用與非門2個輸入端并接來代替從而節省芯片。校時電路圖見圖8。 校時電路圖(5)整點報時電路 一般時鐘都應具備整點報時電路功能,即在時間出現整點前數秒內,數字鐘會自動報時,以示提醒。其作用方式是發出連續的或有節奏的音頻聲波。當時間在59分50秒到59分59秒期間時,分十位、分個位和秒十位均保持不變,分別為5、9和5,因此可將分計數器十位的QC和QA、個位的QD和QA及秒計數器十位的QC 和QA相與。電路在整點前6秒鐘內開始整點報時,即當時間在59分54秒到59分59秒期間時,報時電路產生報時控制信號,控制小喇叭產生低音;當時間為00分00秒時,報時電路產生報時控制信號,控制小喇叭產生高音。 5、軟件調試方法與運行結果說明(1)軟件調試方法 由于仿真時晶振不能正常工作,所以通過外接1KHz方波信號來調試電路。“時”“分”“秒”電路的調試:“時”為24進制(從“00”到“23”),“分”和“秒”都為60進制(從“00”到“59”)。校時電路的調試:可以通過校時、校分電路的開關來校對時間,并判斷電路的“時”“分”“秒”的進制是否正確。開關斷開時電路處于正常工作狀態,開關閉合時電路處于校時、校分狀態。(2)運行結果說明 數碼管的各部分可以正確顯示,電路的“時”為24進制(從“00”到“23”),“分”和“秒”都為60進制(從“00”到“59”)。開關斷開時電路處于正常工作狀態,開關閉合時電路處于校時、校分狀態,通過控制開關及輸入信號可以達到校時功能。 三、設計體會與建議 1.設計體會 我覺得此次的數字鐘設計實驗,電路原理相對來比較簡單,但電路圖比較復雜,所用芯片比較多,相應的連線也多,這就給焊接電路增加了較大的難度。不過通過此次實驗,使我更進一步地熟悉了芯片的結構,掌握了實驗中所用各芯片的工作原理和其具體的使用方法,同時還接觸到了一些新認識的芯片,增長了見識。這次課程設計是一次難得的鍛煉機會,讓我們能夠充分運用所學過的理論知識和自己動手實際操作的能力,另外還讓我們學習查找資料的方法,以及自己設計電路、焊接電路、分析解決電路存在的問題的能力。這對于我來說是很好的提高,填補了平日理論學習后實踐方面的空白。參考文獻 [1] 閻石.數字電子技術基礎[M].北京:高等教育出版社,2001年 [2] 楊素行.模擬電子技術基礎簡明教程[M].北京:高等教育出版社,2005年 [3]康華光.電子技術基礎[M].北京:高等教育出版社,1999年 [4]彭華林等編.數字電子技術[M].長沙:湖南大學出版社,2004年 [5]金唯香等編.電子測試技術[M].長沙:湖南大學出版社,2004年 課程設計任務書 學生姓名:專業班級:指導教師:工作單位:題目:多功能數字鐘的設計與實現初始條件: 本設計既可以使用集成譯碼器、計數器、定時器、脈沖發生器和必要的門電路等,也可以使用單片機系統構建多功能數字鐘。用數碼管顯示時間計數值。 要求完成的主要任務:(包括課程設計工作量及技術要求,以及說明書撰寫等具體要求) 1、課程設計工作量:1周。 2、技術要求: 1)設計一個數字鐘。要求用六位數碼管顯示時間,格式為00:00:00。 2)具有60進制和24進制(或12進制)計數功能,秒、分為60進制計數,時為24進制(或12進制)計數。 3)有譯碼、七段數碼顯示功能,能顯示時、分、秒計時的結果。 4)設計提供連續觸發脈沖的脈沖信號發生器,5)具有校時單元、鬧鐘單元和整點報時單元。 6)確定設計方案,按功能模塊的劃分選擇元、器件和中小規模集成電路,設計分電路,畫出總體電路原理圖,闡述基本原理。 3、查閱至少5篇參考文獻。按《******大學課程設計工作規范》要求撰寫設計報告書。全文用A4紙打印,圖紙應符合繪圖規范。 時間安排: 1、年月 2、年月日,方案選擇和電路設計。 3、年月日,電路調試和設計說明書撰寫。 4、年月 指導教師簽名:年月日 系主任(或責任教師)簽名:年月日第二篇:多功能數字鐘設計
第三篇:多功能數字鐘課程設計VHDL代碼書上程序改
第四篇:多功能數字鐘課程設計報告
第五篇:多功能數字鐘