欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      用VHDL語言編寫的數(shù)字鐘程序5篇

      時間:2019-05-12 07:07:02下載本文作者:會員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《用VHDL語言編寫的數(shù)字鐘程序》,但愿對你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《用VHDL語言編寫的數(shù)字鐘程序》。

      第一篇:用VHDL語言編寫的數(shù)字鐘程序

      永州職業(yè)技術(shù)學(xué)院

      課 程 設(shè) 計

      課程名稱: EDA技術(shù)實用教程 題 目:基于FPGA的數(shù)字鐘設(shè)計 系、專業(yè): 電子技術(shù)系應(yīng)用電子 年級、班級: 07級電子大專 學(xué)生姓名: 馮 苗 指導(dǎo)老師: 龍 安 國 時 間: 2008年12月

      目 錄

      一、系統(tǒng)設(shè)計………………………………………………………..1.1設(shè)計要求…………………………………………………… 1.1.1任務(wù)………………………………………………..1.1.2要求……………………………………………….1.1.3題目分析………………………………………… 二.方案論證與比較…………………………………

      2.1方案一 …………………………………………

      2.2 方案二 ………………………………………… 2.3 方案三 …………………………………………

      三、設(shè)計思路……………………………………………………

      3.1硬件模塊……………………………………………… 3.2軟件模塊………………………………………………….四、調(diào)試情況………………………………………………….五、系統(tǒng)調(diào)試…………………………………………………

      六、心得體會……………………………………………………...附:參考文獻……………………………………………………..用VHDL語言編寫的數(shù)字鐘程序

      摘要:本設(shè)計要求一個12進制或24進制的具有時、分、秒計時功能的數(shù)字鐘,并要求能進行時、分、秒調(diào)整,每逢時有報時功能。數(shù)字鐘是一種用數(shù)字電路技術(shù)實現(xiàn)時、分、秒計時的裝置,與機械式時鐘相比具有更高的準確性和直觀性,且無機械裝置,具有更更長的使用壽命,因此得到了廣泛的使用。本設(shè)計基于FPGA芯片的數(shù)字鐘的設(shè)計,通過多功能數(shù)字鐘的設(shè)計思路,詳細敘述了整個系統(tǒng)的硬件、軟件實現(xiàn)過程,實現(xiàn)了時間的顯示和修改功能、報時功能等,并盡可能的減少誤差,使得系統(tǒng)可以達到實際數(shù)字鐘的允許誤差范圍內(nèi)。

      關(guān)鍵詞:FBGA、數(shù)碼管、按鍵

      一、系統(tǒng)設(shè)計

      1.1 設(shè)計要求 1.1.1 任務(wù)

      設(shè)計并制作一個數(shù)字鐘,通過設(shè)計,掌握電子設(shè)計的一般思路,學(xué)習(xí)電子設(shè)計的一般方法。

      1.1.2要求

      (1)基本要求

      ①計時功能:這是數(shù)字鐘的基本功能,每隔一秒鐘計時一次,并在顯示屏上顯示當(dāng)前時間。

      ②校時功能:能設(shè)置實時時間作為數(shù)字鐘的當(dāng)前時間,具有小時、分鐘的手動校準時間功能。

      (2)發(fā)揮部分

      ①計時進制的選擇功能:十二小時制或二十四小時制可選擇控制; ②整點報警功能:每逢整點自動報警; ③其他創(chuàng)新功能。二.方案論證與比較

      2.1、方案一:采用74LS163和CD4046設(shè)計數(shù)字鐘

      圖1.1.1 方案一電路圖

      晶體振蕩器電路給數(shù)字鐘提供一個頻率穩(wěn)定準確的32768Hz的方波信號,可保證數(shù)字鐘的走時準確及穩(wěn)定。不管是指針式的電子鐘還是數(shù)字顯示的電子鐘都使用了晶體振蕩器電路。由CD4046組成的分頻器電路將32768Hz的高頻方波信號經(jīng)32768(2次分頻后得到2Hz的方波信號經(jīng)過D觸發(fā)器二分頻得到秒信號供秒計數(shù)器進行計數(shù)。分頻器實際上也就是計數(shù)器。時間計數(shù)電路由秒個位和秒十位計數(shù)器、分個位和分十位計數(shù)器及時個位和時十位計數(shù)器電路構(gòu)成,其中秒個位和秒十位計數(shù)器、分個位和分十位計數(shù)器為60進制計數(shù)器,而根據(jù)設(shè)計要求,時個位和時十位計數(shù)器為12進制計數(shù)器。時間計數(shù)器由74LS163組成.譯碼驅(qū)動電路將計數(shù)器輸出的8421BCD碼轉(zhuǎn)換為數(shù)碼管需要的邏輯狀態(tài),并且為保證數(shù)碼管正常工作提供足夠的工作電流。數(shù)碼管通常有發(fā)光二極管(LED)數(shù)碼管和液晶(LCD)數(shù)碼管,本設(shè)計提供的為LED數(shù)碼管。

      14)

      2、方案二:采用AT89C52單片機、數(shù)碼管設(shè)計數(shù)字鐘

      圖1.1.2 方案二電路圖

      本方案采用AT89C52單片機,單片機的P1口接數(shù)碼管顯示電路,P0口接鍵控制數(shù)碼管的顯示,P2.0口接入整點報時電路,RESET接入復(fù)位和晶振電路。該電路能否成功,關(guān)鍵在于程序的編寫而對元器件的要求不太高。用匯編編寫得數(shù)字鐘電路,采用分支結(jié)構(gòu)編寫,利用跳轉(zhuǎn)指令與大量的中斷指令.當(dāng)沒有按鍵掃描沒有按鍵按下時,程序正常計數(shù),當(dāng)檢測到有鍵按下時,程序運轉(zhuǎn)到相應(yīng)中斷程序進行響應(yīng)處理.從而實現(xiàn)了分支程序的處理.方案三:采用FPGA制成的數(shù)字鐘

      圖1.1.3 方案三電路圖

      市電經(jīng)過降壓電路為FPGA芯片提供3.3V的直流電壓,12MHZ的晶振信號加入到FPGA芯片的內(nèi)定義PORT,切換鍵、調(diào)時鍵,輸出的8個四位的BCD碼,經(jīng)過數(shù)據(jù)選擇器使得某一位信號的BCD碼被選中,被選中的信號經(jīng)過3/8譯碼電路,送到數(shù)碼管的進行段碼顯示.而數(shù)碼管的位選端也有內(nèi)部軟件編程實現(xiàn)位選.而由時、分,信號為蜂鳴器提供鬧鐘信號.并口端為程序輸入端.三.設(shè)計思路

      3.1硬件模塊

      采用ALTER公司的ACE×1K系列的EP1K10TC100-3芯片,通過Quartus軟件編譯各個管腳的功能及特性.接入12MHZ時鐘信號,經(jīng)過內(nèi)部軟件分頻.得到1HZ和1000HZ信號,得到的1HZ時鐘信號作為內(nèi)部秒個位計數(shù)模塊的時鐘信號,秒個位進行十進制計數(shù),到9進位,為秒十位提供6進制時鐘信號,當(dāng)秒為59時,為分鐘提供時鐘信號.當(dāng)秒進位信號作為低位十進制分計數(shù)器時鐘.分鐘計數(shù)器為59時,為小時計數(shù)器的個位提供時鐘信號,當(dāng)小時計數(shù)器、分鐘計數(shù)器輸出信號與鬧鐘預(yù)設(shè)信號一樣時,揚聲器發(fā)聲.輸出信號經(jīng)過數(shù)據(jù)選擇器選擇1位BCD碼輸出到譯碼電路,譯碼后送到數(shù)碼管顯示.位選擇信號為數(shù)碼管顯示提供條件.而分頻得到的1KHZ的時鐘頻率作為位選計數(shù)器的時鐘信號.由于該方案簡單而且可靠性高,故采用此種方案.該數(shù)字鐘可以實現(xiàn)3個功能:計時功能、整點報時功能和重置時間功能,因此有3個子模塊:計時、報時(alarm1)、重置時間(s1、m1、h1、d1)。其中計時模塊有4部分構(gòu)成:秒計時器(second1)、分計時器(minute1)、時計時器(hour1)和星期計時器(day1)。

      該數(shù)字鐘可以實現(xiàn)3個功能:計時功能、整點報時功能和重置時間功能,因此有3個子模塊:計時、報時(alarm1)、重置時間(s1、m1、h1、d1)。其中計時模塊有4部分構(gòu)成:秒計時器(second1)、分計時器(minute1)、時計時器(hour1)和星期計時器(day1)。

      3.2軟件模塊 1)、分頻器模塊

      其實是一個計數(shù)器,外加信號頻率為12MHZ時,在內(nèi)部定義了一個信號從0到11999999的整數(shù)型計數(shù)信號count1,當(dāng)內(nèi)部信號計數(shù)為11999999時,count1計數(shù)為0,產(chǎn)生進位信號CLK1為1,其余時間計數(shù)器正常計數(shù).CLK為0,從而實現(xiàn)了12000000次分頻.得到1HZ的時鐘信號.內(nèi)部定義了一個從0到11999的整數(shù)性信號countf,當(dāng)內(nèi)部信號計數(shù)為11999時,countf計數(shù)為0,產(chǎn)生進位信號CLK1為1,其余時間計數(shù)器正常計數(shù).CLK為0,從而實現(xiàn)了12000次分頻.得到1KHZ的時鐘信號的位選信號.2)、秒計數(shù)模塊

      內(nèi)部定義時鐘其余時刻均為為秒計時器(second1)是由一個60進制的計數(shù)器構(gòu)成的,具有清0、置數(shù)和計數(shù)功能。其中reset為清0信號,當(dāng)reset為0時,秒計時器清0;set 為置數(shù)信號,當(dāng)set為0時,秒計時器置數(shù),置s1的值。clk為驅(qū)動秒計時器的時鐘,sec為秒計時器的輸出,ensec為秒計時器的進位信號,作為下一級的時鐘輸入信號。

      3)、分計時器(minute1)是由一個60進制的計數(shù)器構(gòu)成的,具有清0、置數(shù)和計數(shù)功能。其中reset為清0信號,當(dāng)reset為0時,分計時器清0;set 為置數(shù)信號,當(dāng)set為0時,分計時器置數(shù),置m1的值。clkm為驅(qū)動分計時器工作的時鐘,與ensec相連接;min為分計時器的輸出;enmin為分計時器的進位信號,作為下一級的時鐘輸入信號。4)、時計時器(hour1)模塊

      是由一個24進制的計數(shù)器構(gòu)成的,具有清0、置數(shù)和計數(shù)功能。其中reset為清0信號,當(dāng)reset為0時,時計時器清0;set 為置數(shù)信號,當(dāng)set為0時,時計時器置數(shù),置h1的值。clkh為驅(qū)動時計時器工作的時鐘,與enmin相連接;hour為時計時器的輸出;enhour為時計時器的進位信號,作為下一級的時鐘輸入信號。

      圖7

      5)、報時模塊(alarm1)的功能是當(dāng)整點(將min作為該模塊的輸入信號,min=00)時,alarm輸出高電平,并且持續(xù)1分鐘。清0端(reset)前面一小段(200ns)為低電平,后面均為高電平;設(shè)置min的值,使其分別為……58分、59分、00分、01分、02分、03分……,保存波形圖,進行仿真,產(chǎn)生如下波形: 7

      見由上述波形可以清楚的看到:alarm在0分時輸出高電平,并且持續(xù)至1min不為0。

      6)、去抖模塊

      定義變量fb范圍0到29999,當(dāng)外部時鐘信號來臨時候,fp計數(shù),只有當(dāng)FP為29999時,fp賦值為0.內(nèi)部5ms信號反向輸出.輸出5ms時鐘信號,該信號送到內(nèi)部的D觸發(fā)器中,只有按鍵按下且5ms時鐘信號來臨時,按鍵信號才被送到觸發(fā)器.從而實現(xiàn)了去抖.7)、系統(tǒng)總調(diào)試(topclock)(Endtime為10us

      在秒計時器的clk輸入一個周期為5ns的時鐘信號;清0端(reset)前面一小段(40ns)為低電平,后面均為高電平;置數(shù)端(set)前面一小段(60ns)為低電平,后面均為高電平;秒重置端(s1)可設(shè)置數(shù)值為50秒,分重置端(m1)可設(shè)置數(shù)值為57分, 時重置端(h1)可設(shè)置數(shù)值為23時, 星期重置端(d1)可設(shè)置數(shù)值為6(星期六);保存波形圖,進行仿真,產(chǎn)生如下波形”

      圖8

      由上述波形可以清楚的看到:當(dāng)reset為0時,數(shù)字鐘清0;當(dāng)set為1時,數(shù)字鐘置數(shù)

      圖9由上述波形可以清楚的看到:秒計時器開始計時,當(dāng)?shù)竭_59秒后,秒計時器sec又從0開始計時,同時分鐘min加了1,為58分。

      由上述波形可以清楚的看到:分計時器開始計時,當(dāng)?shù)竭_59分后,分計時器min又從0開始計時,同時小時hour加了1,為24時,即時計時器hour也又從0開始計時,而此時星期計時器day也由6加1后回0,又從0開始計時。當(dāng)分計時器min為0時,alarm輸出一個高電平,持續(xù)直到分計時器min的值為1。

      圖10

      8)、用經(jīng)過5ms去抖程序后,使得keyout輸出一個脈沖,將此信號作為按鍵代碼計數(shù)電路.為每一種按鍵代碼賦已一定功能.從而實現(xiàn)一鍵控制.

      程序流程圖如下:

      詳細程序見附錄。程序控制過程如下說明:

      四、產(chǎn)品調(diào)試與結(jié)果分析 1)書寫遺漏

      錯誤提示在305行和307行附近有一個錯誤,沒有加IF.查看后發(fā)現(xiàn)由于自己的疏忽,在結(jié)束時,沒有加END IF.將307行中加入一行結(jié)束語句,問題解決.2)數(shù)碼管顯示時有閃爍

      檢查掃描信號時鐘時,發(fā)現(xiàn)掃描信號時鐘為100HZ,掃描頻率過低,引起閃爍.檢查分頻部分程序,發(fā)現(xiàn)掃描信號頻率設(shè)為100HZ,將掃描信號頻率改為1000KHZ.然后發(fā)現(xiàn)無閃爍.修改有效.3)數(shù)碼管秒個位顯示時無2、8字符

      檢查后發(fā)現(xiàn)秒個位譯碼部分字符書寫錯誤.將秒個位字符2、8賦值錯誤修改觀察,有顯示.五、心得體會

      轉(zhuǎn)眼一學(xué)期就要悄悄走遠,感覺這些天是我學(xué)的最多的.通過這次設(shè)計,進一步加深了對EDA的了解,讓我對它有了更加濃厚的興趣。特別是當(dāng)每一個子模塊編寫調(diào)試成功時,心里特別的開心。但是在編寫頂層文件的程序時,遇到了不少問題,特別是各元件之間的連接,以及信號的定義,總是有錯誤,在細心的檢查下,終于找出了錯誤和警告,排除困難后,程序編譯就通過了,心里終于舒了一口氣。在波形仿真時,也遇到了一點困難,想要的結(jié)果不能在波形上得到正確的顯示:在設(shè)定輸入的時鐘信號后,數(shù)字鐘開始計數(shù),但是始終看不到小時、星期的循環(huán)計數(shù)。后來,在數(shù)十次的調(diào)試之后,才發(fā)現(xiàn)是因為輸入的時鐘信號對于小時、星期來說太短了。經(jīng)過屢次調(diào)試,終于找到了比較合適的輸入數(shù)值:分鐘的初始值可以設(shè)為57(58、59都可以),小時的初始值可以設(shè)為23,星期的初始值可以設(shè)為6,這樣,仿真之后,就能清楚的看出分鐘、小時的循環(huán)計數(shù)。另外,Endtime的值需要設(shè)置的長一點:10us左右,輸入的時鐘周期值要設(shè)置的短一點:5ns左右。

      總的來說,這次設(shè)計的數(shù)字鐘還是比較成功的,有點小小的成就感,終于覺得平時所學(xué)的知識有了實用的價值,達到了理論與實際相結(jié)合的目的,不僅學(xué)到了不少知識,而且鍛煉了自己的能力,使自己對以后的路有了更加清楚的認識,同時,對未來有了更多的信心。

      附:參考文獻

      1、黃仁欣主編《EDA技術(shù)實訓(xùn)教程》,清華大學(xué)出版社,2006年第2版。

      2、楊志忠主編《數(shù)字電子技術(shù)》,北京高等教育出版社,2003年12第2版。

      3、潘松、黃繼業(yè)主編《單片機實訓(xùn)教程》,科學(xué)出版社,2005年5月第2版。

      附件程序:

      library ieee;use ieee.std_logic_1164.all;

      use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity clock is

      port(clk:in std_logic;--12M時鐘

      keyin:in std_logic;

      speak:out std_logic;--蜂鳴器

      dout:out std_logic_vector(7 downto 0);--段碼

      selout:out std_logic_vector(2 downto 0));--位選 end clock;architecture one of clock is

      signal count:integer range 0 to 11999999;--1HZ秒信號

      signal counf:integer range 0 to 11999;--1000HZ

      SIGNAL CP_5ms : STD_LOGIC;

      SIGNAL Q1,Q2,Q3: STD_LOGIC;

      SIGNAL keyout : STD_LOGIC;

      SIGNAL CJ:STD_LOGIC_VECTOR(2 DOWNTO 0);

      signal sel:std_logic_vector(2 downto 0);--位選

      signal hou1:std_logic_vector(3 downto 0);--計數(shù)中小時的十位

      signal hou2:std_logic_vector(3 downto 0);--小時的個位

      signal min1:std_logic_vector(3 downto 0);--分鐘的十位

      signal min2:std_logic_vector(3 downto 0);--分鐘的個位

      signal sec1:std_logic_vector(3 downto 0);--秒的十位

      signal sec2:std_logic_vector(3 downto 0);--秒的個位

      signal seth1:std_logic_vector(3 downto 0);--設(shè)時中小時的十位

      signal seth2:std_logic_vector(3 downto 0);--小時的個位

      signal setm1:std_logic_vector(3 downto 0);--分鐘的十位

      signal setm2:std_logic_vector(3 downto 0);--分鐘的個位

      signal h1:std_logic_vector(3 downto 0);---顯示小時十位

      signal h2:std_logic_vector(3 downto 0);---小時的個位

      signal m1:std_logic_vector(3 downto 0);--分鐘的十位

      signal m2:std_logic_vector(3 downto 0);--分鐘的個位

      signal s1:std_logic_vector(3 downto 0);--秒的十位

      signal s2:std_logic_vector(3 downto 0);--秒的個位

      signal clk1,clkk,beep:std_logic;

      begin-----------------分頻 fp:process(clk)

      begin

      if rising_edge(clk)then

      count<=count+1;

      counf<=counf+1;

      if count=11999999 then clk1<='1';---1Hz

      count<=0;

      beep<='1';

      elsif count>5999999 then beep<='0';---2Hz

      else clk1<='0';

      end if;

      if counf=11999 then clkk<='1';--1000HZ

      counf<=0;

      else clkk<='0';

      end if;

      end if;end process fp;---------------位掃描 choice:process(clkk)---位選

      掃描

      begin

      if rising_edge(clkk)then

      if sel=“111” then

      sel<=“000”;

      else

      sel<=sel+1;

      end if;

      end if;end process choice;-------------秒個位 s220:process(clk1,cj)

      begin

      if clk1'event and clk1='1' then

      if sec2=“1001” then

      ---其中sec2是秒的個位

      sec2<=“0000”;

      elsif cj=“010” then

      sec2<=sec2;

      else sec2<=sec2+1;

      end if;

      end if;if cj=“001” then sec2<=“0000”;---秒個位復(fù)位

      end if;end process s220;--------------秒十位 s110:process(clk1,cj)

      begin

      if clk1'event and clk1='1' then

      if(sec1=“0101” and sec2=“1001”)then---其中sec1是秒鐘的十位

      sec1<=“0000”;

      elsif cj=“010” then

      sec1<=sec1;

      else if sec2=“1001”then

      sec1<=sec1+1;

      end if;

      end if;end if;if cj=“001” then sec1<=“0000”;---秒十位復(fù)位

      end if;end process s110;---------------分鐘個位 m220:process(clk1,sec1,sec2,cj)

      begin

      if clk1'event and clk1='1' then

      if min2=“1001”and(sec1=“0101” and sec2=“1001”)then----其中min2是分鐘的個位

      min2<=“0000”;

      elsif min2=“1001”and(cj=“011” and cj=“100”)then---

      min2<=“0000”;

      else if(sec1=“0101” and sec2=“1001”)or(cj=“011” and cj=“100”)then

      min2<=min2+1;

      end if;

      end if;end if;if cj=“001” then min2<=“0000”;

      end if;

      end process m220;----------------分鐘十位 m110:process(clk1,min2,sec1,sec2,cj)

      begin

      if clk1'event and clk1='1' then

      if(min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”)then

      min1<=“0000”;

      elsif min1=“0101”and min2=“1001”and(cj=“011” and cj=100)then

      min1<=“0000”;

      elsif(min2=“1001”and(sec1=“0101” and sec2=“1001”))or(min2=“1001”and cj=“011” and cj=“100”)then

      min1<=min1+1;

      end if;

      end if;--end if;if cj=“001” then min1<=“0000”;

      end if;end process m110;----------------小時個位

      h220:process(clk1,min1,min2,sec1,sec2,cj,hou1)

      begin

      if clk1'event and clk1='1' then

      if(hou1=“0010” and hou2=“0011”)and(min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”)then

      hou2<=“0000”;

      elsif hou2=“1001”and(min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”)then

      hou2<=“0000”;

      elsif(hou2=“1001”and cj=“110”)or(hou1=“0010”and hou2=“0011”and cj=“110”)then

      hou2<=“0000”;--md<='1';

      elsif((min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”))or(cj=“110”)then

      hou2<=hou2+1;--speak<=clk;

      end if;

      end if;if cj=“001” then hou2<=“0000”;

      end if;end process h220;----------------小時十位 h110:process(clk1,hou2,min1,min2,sec1,sec2,cj)

      begin

      if clk1'event and clk1='1' then

      if(hou1=“0010” and hou2=“0011”)and(min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”)then

      hou1<=“0000”;

      elsif hou1=“0010”and hou2=“0011”and cj=“110” then--當(dāng)時間為23點且處于校時狀態(tài)時

      hou1<=“0000”;

      elsif(hou2=“1001”and(min1=“0101” and min2=“1001”)and(sec1=“0101” and sec2=“1001”))or(hou2=“1001”and cj=“110”)then

      hou1<=hou1+1;

      end if;

      end if;if cj=“001” then hou1<=“0000”;

      end if;end process h110;------------時間設(shè)置小時部分 sethour1:process(clk1,seth1,seth2,cj)

      begin

      if clk1'event and clk1='1' then

      if seth1=“0010”and seth2=“0011” then

      seth1<=“0000”;

      elsif seth2=“1001” then

      seth1<=seth1+1;

      end if;

      end if;if cj=“001” then seth1<=“0000”;end if;end process sethour1;------------sethour2:process(clk1,seth1,cj)

      begin

      if clk1'event and clk1='1' then

      if(seth1=“0010”and seth2=“0011”)or seth2=“1001” then

      ---其中seth1,seth2分別是調(diào)時的小時部位的十位與個位

      seth2<=“0000”;

      elsif cj=“111” then

      seth2<=seth2+1;

      end if;

      end if;if cj=“001” then seth2<=“0000”;

      end if;end process sethour2;------------時間設(shè)置分鐘部分 setmin1:process(clk1,setm2,cj)

      begin

      if clk1'event and clk1='1' then

      if setm1=“0101”and setm2=“1001” then

      setm1<=“0000”;

      elsif setm2=“1001” then

      setm1<=setm1+1;

      end if;

      end if;if cj=“001” then setm1<=“0000”;

      end if;end process setmin1;---------------setmin2:process(clk1,cj)

      begin

      if clk1'event and clk1='1' then

      if setm2=“1001” then

      setm2<=“0000”;

      elsif cj=“101” then

      setm2<=setm2+1;

      end if;

      end if;if cj=“001” then setm2<=“0000”;

      end if;end process setmin2;-------------鬧鈴

      speaker:process(clkk,hou1,hou2,min1,min2,cj)

      begin

      if clkk'event and clkk='1'then

      if seth1=hou1 and seth2=hou2 and setm1=min1 and setm2=min2 then

      speak<=beep;

      else speak<='0';

      end if;

      end if;if cj=“001” then speak<='0';

      end if;end process speaker;------------disp:process(sel,cj,hou1,hou2,min1,min2,sec1,sec2,seth1,seth2,setm1,setm2)---顯示

      begin

      if sel=“010” then

      selout<=“010”;--位選

      case h1 is

      ---顯示小時的十位

      when “0000”=>dout<=“00111111”;---0

      when “0001”=>dout<=“00000110”;---1

      when “0010”=>dout<=“01011011”;---2

      when others =>dout<=“00000000”;---不顯示

      end case;

      elsif sel=“011” then

      selout<=“011”;

      case h2 is

      ---顯示小時的個位

      when “0000”=>dout<=“10111111”;---0

      when “0001”=>dout<=“10000110”;---1

      when “0010”=>dout<=“11011011”;---2

      when “0011”=>dout<=“11001111”;---3

      when “0100”=>dout<=“11100110”;---4

      when “0101”=>dout<=“11101101”;---5

      when “0110”=>dout<=“11111101”;---6

      when “0111”=>dout<=“10000111”;---7

      when “1000”=>dout<=“11111111”;---8

      when “1001”=>dout<=“11101111”;---9

      when others=>dout<=“10000000”;---不顯示

      end case;

      elsif sel=“100” then

      selout<=“100”;

      case m1 is

      ---顯示分鐘的十位

      when “0000”=>dout<=“00111111”;

      when “0001”=>dout<=“00000110”;

      when “0010”=>dout<=“01011011”;

      when “0011”=>dout<=“01001111”;

      when “0100”=>dout<=“01100110”;

      when “0101”=>dout<=“01101101”;

      when others=>dout<=“00000000”;

      end case;

      elsif sel=“101” then

      selout<=“101”;

      case m2 is

      ---顯示分鐘的個位

      when “0000”=>dout<=“10111111”;

      when “0001”=>dout<=“10000110”;

      when “0010”=>dout<=“11011011”;

      when “0011”=>dout<=“11001111”;

      when “0100”=>dout<=“11100110”;

      when “0101”=>dout<=“11101101”;

      when “0110”=>dout<=“11111101”;

      when “0111”=>dout<=“10000111”;

      when “1000”=>dout<=“11111111”;

      when “1001”=>dout<=“11101111”;

      when others=>dout<=“10000000”;

      end case;

      elsif sel=“110” then

      selout<=“110”;

      case s1 is

      ---顯示秒的十位

      when “0000”=>dout<=“00111111”;

      when “0001”=>dout<=“00000110”;

      when “0010”=>dout<=“01011011”;

      when “0011”=>dout<=“01001111”;

      when “0100”=>dout<=“01100110”;

      when “0101”=>dout<=“01101101”;

      when others=>dout<=“00000000”;

      end case;

      elsif sel=“111” then

      selout<=“111”;

      case s2 is

      ---顯示秒的個位

      when “0000”=>dout<=“00111111”;

      when “0001”=>dout<=“10000110”;

      when “0010”=>dout<=“01011011”;

      when “0011”=>dout<=“11001111”;

      when “0100”=>dout<=“01100110”;

      when “0101”=>dout<=“11101101”;

      when “0110”=>dout<=“01111101”;

      when “0111”=>dout<=“10000111”;

      when “1000”=>dout<=“01111111”;

      when “1001”=>dout<=“11101111”;

      when others=>dout<=“00000000”;

      end case;

      end if;

      if cj=“011” then---------------計時時間顯示和設(shè)置模式

      h1<=hou1;h2<=hou2;

      m1<=min1;m2<=min2;

      s1<=sec1;s2<=sec2;

      else

      -----------鬧鈴時間現(xiàn)實和設(shè)置模式

      h1<=seth1;h2<=seth2;

      m1<=setm1;m2<=setm2;

      s1<=“1111”;s2<=“1111”;

      end if;end process disp;--------------------------yanshi:process(clk)variable fp:integer range 0 to 29999;begin if clk'event and clk='1' then if fp=29999 then fp:=0;

      CP_5ms<= not CP_5ms;else

      fp:=fp+1;end if;end if;end process;------------------quout:process(CP_5ms,keyin)begin if CP_5ms'event and CP_5ms='1' then Q1<=keyin;Q2<=Q1;Q3<=Q2;end if;end process;-------------------process(Q1,Q2,Q3)begin if(Q1='0' and Q2='0' and Q3='0')then keyout<='0';else keyout<='1';end if;end process;process(keyout,CJ)begin if Rising_edge(keyout)then if cj=“111” then cj<=“000”;

      else CJ<=CJ+1;end if;end if;end process;end

      one;

      第二篇:多功能數(shù)字鐘課程設(shè)計VHDL代碼書上程序改

      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;--星期調(diào)整脈沖--start_stop:in std_logic;--秒表啟動/停止控制--reset:in std_logic;--秒表復(fù)位--adclk:in std_logic;--校時脈沖--setselect:in std_logic;--調(diào)整位選擇脈沖--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;--調(diào)整脈沖--

      setlap: out std_logic_vector(1 downto 0);--調(diào)整位選擇脈沖--

      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;--計數(shù)脈沖--

      clr: in std_logic;--復(fù)位--

      q: out std_logic_vector(7 downto 0);--計數(shù)值--

      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計數(shù)脈沖--

      en: in std_logic;--計數(shù)使能--

      clr: in std_logic;--復(fù)位--

      q: out std_logic_vector(7 downto 0);--計數(shù)值--

      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;--計數(shù)脈沖--

      set: in std_logic;--調(diào)整信號--

      day_in: in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;--年份高位數(shù)字bcd碼最低位--

      year1: in std_logic_vector(1 downto 0);--年份低位數(shù)字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);--秒表計數(shù)值輸入--

      time:in std_logic_vector(23 downto 0);--時分秒計數(shù)值輸入--date:in std_logic_vector(23 downto 0);--年月日計數(shù)值輸入--

      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;--調(diào)整信號--

      setlap: in std_logic_vector(1 downto 0);--調(diào)整位選擇--

      d: in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;--調(diào)整信號--

      setlap: in std_logic_vector(1 downto 0);--調(diào)整位選擇--

      d:in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;--計數(shù)脈沖--

      set:in std_logic;--調(diào)整信號--

      d:in std_logic_vector(7 downto 0);--調(diào)整時間--

      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;--計數(shù)脈沖--

      set: in std_logic;--調(diào)整信號--

      month_in: in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;--計數(shù)脈沖--

      set:in std_logic;--調(diào)整信號--

      d:in std_logic_vector(7 downto 0);--調(diào)整時間輸入--

      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;--復(fù)位--

      start_stop: in std_logic;--啟動/停止--

      centsec: out std_logic_vector(7 downto 0);--百分秒輸出,當(dāng)超過60分轉(zhuǎn)為秒--

      sec: out std_logic_vector(7 downto 0);--秒輸出,當(dāng)超過60分轉(zhuǎn)為分--

      min: out std_logic_vector(7 downto 0)--分輸出,當(dāng)超過60分轉(zhuǎn)為小時--);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;--外部星期調(diào)整脈沖--

      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;--計數(shù)脈沖--

      set: in std_logic;--調(diào)整信號--

      setlap: in std_logic_vector(1 downto 0);--調(diào)整位選擇--

      data_in: in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;--計數(shù)脈沖--

      set: in std_logic;--調(diào)整信號--

      year_in: in std_logic_vector(7 downto 0);--調(diào)整輸入--

      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;

      第三篇:C語言課程設(shè)計數(shù)字鐘程序

      C語言數(shù)字鐘程序

      #include“stdio.h” void clock(int t);void main(){ int t,i,j,n;for(t=0;t<10;t++){ clock(t);sound(590);for(n=0;n<4;n++){ delay(100000000);} nosound();for(n=0;n<6;n++){ delay(100000000);} for(j=8;j<=18;j++){ for(i=1;i<=80;i++){ gotoxy(i,j);putchar(0);} } } } void clock(int t){ int i,j;textcolor(11);if(t==0){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<11;i++){ gotoxy(51,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=10){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==1){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} } if(t==2){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(60-j*8,8+i+j*5);cprintf(“%c”,14);} } for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==3){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==4){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<6;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(i=0;i<8;i++){ gotoxy(59-i,13);cprintf(“%c”,14);} } if(t==5){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(52+j*8,8+i+j*5);cprintf(“%c”,14);} } for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==6){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(52+j*8,8+i+j*5);cprintf(“%c”,14);} } for(i=0;i<6;i++){ gotoxy(52,13+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==7){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<8;i++){ gotoxy(59-i,8);cprintf(“%c”,14);} } if(t==8){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<11;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==9){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<6;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(j=0;j<2;j++){ for(i=0;i<8;i++){ gotoxy(59-i,8+j*5);cprintf(“%c”,14);} } } }

      第四篇:數(shù)字鐘程序-c語言課程設(shè)計

      #include“stdio.h” void clock(int t);void main(){ int t,i,j,n;for(t=0;t<10;t++){ clock(t);sound(590);for(n=0;n<4;n++){ delay(100000000);} nosound();for(n=0;n<6;n++){ delay(100000000);} for(j=8;j<=18;j++){ for(i=1;i<=80;i++){ gotoxy(i,j);putchar(0);} } } } void clock(int t){ int i,j;textcolor(11);if(t==0){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<11;i++){ gotoxy(51,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=10){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==1){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} } if(t==2){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(60-j*8,8+i+j*5);cprintf(“%c”,14);} } for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==3){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==4){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<6;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(i=0;i<8;i++){ gotoxy(59-i,13);cprintf(“%c”,14);} } if(t==5){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(52+j*8,8+i+j*5);cprintf(“%c”,14);} } for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==6){ for(j=0;j<2;j++){ for(i=0;i<6;i++){ gotoxy(52+j*8,8+i+j*5);cprintf(“%c”,14);} } for(i=0;i<6;i++){ gotoxy(52,13+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<9;i++){ gotoxy(60-i,8+j);cprintf(“%c”,14);} } } if(t==7){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<8;i++){ gotoxy(59-i,8);cprintf(“%c”,14);} } if(t==8){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<11;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(j=0;j<11;j+=5){ for(i=0;i<8;i++){ gotoxy(59-i,8+j);cprintf(“%c”,14);} } } if(t==9){ for(i=0;i<11;i++){ gotoxy(60,8+i);cprintf(“%c”,14);} for(i=0;i<6;i++){ gotoxy(52,8+i);cprintf(“%c”,14);} for(j=0;j<2;j++){ for(i=0;i<8;i++){ gotoxy(59-i,8+j*5);cprintf(“%c”,14);} } } }

      第五篇:如何編寫和語言程序解讀

      如何編寫和匯編語言程序

      可以用普通文本編輯器編輯匯編語言源程序。常用的有 MS-DOS 下的 EDIT 文本編輯程序,Windows 下的寫字板(WORDPAD.EXE)等。用戶通過屏幕編輯程序鍵入源程序,檢查無誤,可將源程序存到匯編系統(tǒng)盤上,該程序的擴展名為· ASM。軟件運行基本環(huán)境

      運行匯編程序必備的軟件環(huán)境: DOS 操作系統(tǒng);匯編系統(tǒng)。匯編系統(tǒng)盤應(yīng)包含如下文件: MASM 宏匯編程序文件 LISK 連接程序文件

      CRFF 索引程序文件(也可不用)匯編源程序編寫)源程序的書寫格式

      當(dāng) CPU 訪問內(nèi)存時,是把存儲器分成若干個段,通過 4 個段寄存器中存放的地址對內(nèi)存儲器訪問,因此在編源程序時必須按段的結(jié)構(gòu)來編制程序。由于每個段的物理空間為≤ 64KB,所以程序中各段可以分別為一個或幾個。源程序的書寫一般有如下形式:

      邏輯堆棧段 堆棧段名 SEGMENT STACK 用變量定義預(yù)置的堆棧空間 · ·

      堆棧段名 ENDS 邏輯數(shù)據(jù)段 數(shù)據(jù)段名 SEGMENT 用變量定義預(yù)置的數(shù)據(jù)空間 · ·

      數(shù)據(jù)段名 ENDS 邏輯代碼段 代碼段名 SEGMENT ASSUME 定義各段尋址關(guān)系 過程名 PROC … 程序 · ·

      過程名 ENDP 代碼段名 ENDS END 過程名或起始標(biāo)號

      在源程序中最少要有一個代碼段,數(shù)據(jù)段根據(jù)需要可有可無,也可以增設(shè)附加段。對于堆棧段也可以根據(jù)需要可有可無,但在連接(LINK)時計算機將顯示警告性的錯誤: Warning : N STACK segment There was 1 error detected.在程序中如果沒有用到堆棧時,該錯誤提示不影響程序的運行,如果程序中用到堆棧時必須設(shè)置堆棧段。其中: SEGMENT、ASSUME、PROC … ENDP 為偽指令,偽指令是發(fā)給匯編程序 ASM 的,而不和微處理器打交道,在匯編時不產(chǎn)生目標(biāo)代碼,只是把源程序中各段的設(shè)置情況告訴匯編程序。)段寄存器的段地址的裝入

      Assume 偽指令語句只是建立了當(dāng)前段與段寄存器的聯(lián)系,但不能把各段的段地址裝入相應(yīng)的段寄存器中,段寄存器的段地址的裝入是在程序中完成的。(1)DS、ES、SS 的裝入

      由于段寄存器不能用立即數(shù)尋址方式直接傳送,所以段地址裝入可通過通用寄存器傳送給段寄存器。MOV AX,邏輯段名 MOV 段寄存器,AX 其中邏輯段名為程序中定義各邏輯段的名字,(不包括代碼段),段寄存器是指與各邏輯段相對應(yīng)的各段寄存器(DS、ES、SS)。(2)CS 的裝入

      代碼段寄存器是裝當(dāng)前執(zhí)行目標(biāo)代碼的段地址,IP 是提供下一條要執(zhí)行的目標(biāo)代碼的偏移量,為了保證程序的正確執(zhí)行,CS 和 IP 裝入新值時是一起完成的。對 CS 和 IP 的裝入有如下幾種情況:

      ①根據(jù)用戶程序中的偽指令 END 后的標(biāo)號為 CS 和 IP 提供代碼段的段地址和目標(biāo)代碼的偏移地址。

      ②在程序運行過程中,當(dāng)執(zhí)行某些指令和操作時,CPU 自動修改 CS 和 IP 的值,使它們指向新的代碼段。)程序中的數(shù)據(jù)與變量

      在匯編源程序中的數(shù)據(jù)除了立即數(shù),由指令產(chǎn)生的數(shù)和通過鍵盤輸入的數(shù)以外,還胡大量的數(shù)據(jù)是通過偽指令語句進行預(yù)置和分配的,也就是在某邏輯段中(除代碼段),將所需的數(shù)據(jù)以某種形式存放起來,在程序中可任意調(diào)用。在數(shù)據(jù)定義的同時還可以定義變量,將變量與數(shù)據(jù)結(jié)合在一起。可以為某個變量分配存儲空間以便在程序執(zhí)行過程中存放中間結(jié)果和最終結(jié)果,使用起來極為方便。

      (1)變量與數(shù)據(jù)的定義

      變量與數(shù)據(jù)的定義可以通過符號定義偽指令 EQU、=和數(shù)據(jù)定義偽指令 DB 或 DW 或 DD 來實現(xiàn)。EQU 和=可以出現(xiàn)在程序的邏輯段內(nèi)也可出現(xiàn)在邏輯段外。

      (2)匯編程序中數(shù)據(jù)的提供方法 ①用數(shù)據(jù)定義偽指令提供數(shù)據(jù)

      如果程序要求原始數(shù)據(jù)為一批數(shù)據(jù)時,用數(shù)據(jù)定義偽指令 DB、DW 和 DD 來提供較為方便。②用立即數(shù)的形式提供數(shù)據(jù)

      當(dāng)原始數(shù)據(jù)只有幾個時,一般用立即數(shù)的方法來提供。當(dāng)然,用立即數(shù)的方法只是將一個數(shù)據(jù)傳送到通用寄存器中,它只是通過通用寄存器傳送數(shù)據(jù)。③用編程的方法提供數(shù)據(jù)

      假如原始數(shù)據(jù)是一組有規(guī)律的數(shù)據(jù)項,則用編程序的方法形成這一組數(shù)據(jù),不用專門為這組數(shù)據(jù)分配存儲單元,節(jié)省了存儲空間。④用鍵盤提供數(shù)據(jù)

      當(dāng)原始數(shù)據(jù)為任意數(shù)據(jù)時,一般用鍵盤輸入方法,調(diào)用 DOS 21H 中斷。

      (3)數(shù)據(jù)的輸出方式 ①在顯示器上顯示一個字符

      調(diào)用 02H 號功能調(diào)用號,發(fā) 21H 號中斷,將要顯示的字符的 ASCII 碼送入 DL,就可在顯示器上顯示該字符。②在打印機上輸出一個字符

      調(diào)用 05H 號功能調(diào)用號,發(fā) 21H 號中斷,將要打印字符的 ASCII 碼送入 DL,就可在打印機上打印出 DL 中的字符。

      4)返回 DOS 狀態(tài)的方法

      當(dāng)執(zhí)行.EXE 文件時,是在 DOS 狀態(tài)下進行的,如果希望在執(zhí)行完.EXE 文件后正常返回 DOS 狀態(tài),一般用如下兩種方法:采用 DOS 4CH 功能調(diào)用和采用返回(RET)斷點的方法。

      匯編處理 — 執(zhí)行宏匯編程序 MASM.EXE

      用匯編語言編寫的源程序必須是一個完整的源程序。宏匯編程序?qū)R編語言源程序的匯編過程包括語法檢查和數(shù)據(jù)代碼匯編兩部分,生成目標(biāo)程序和輔助信息文件。為了完成匯編任務(wù),匯編程序一般采用兩遍掃描的方法,第一遍掃描源程序產(chǎn)生符號表、處理偽指令等,第二遍掃描產(chǎn)生機器指令代碼、確定數(shù)據(jù)等。源程序用宏匯編程序翻譯(匯編)后,可以得到三個文件:一個是擴展名為.OBJ 的目標(biāo)文件,在該文件中,將源程序的操作碼部分變?yōu)闄C器碼,但地址操作數(shù)是可浮動的相對地址,而不是實際地址,因此需經(jīng) LINK 連接文件進行連接才能形成可執(zhí)行文件。第二個文件是列表文件,擴展名為.LST,它把源程序和目標(biāo)程序列表,以供檢查程序用。第三個文件是交叉索引文件,擴展名為.CRF,它是一個對源程序所用的各種符號進行前后對照的文件。其中目標(biāo)文件是必須產(chǎn)生的,而其它兩個文件在需要時給予命令就可產(chǎn)生,對連接和執(zhí)行匯編程序無直接的關(guān)系。)匯編操作過程

      在 DOS 狀態(tài)下,鍵入 MASM ↓則調(diào)入宏匯編程序,屏幕顯示與操作如下: masm ↓ Microsoft(R)Macro Assemble Version 5.00 Copyright(C)Microsoft Corp 1981-1985,1987,All right reserved.Source filename [.ASM ]: MYFILE ↓ Object filename [MYFILE.OBJ ]: MYFILE ↓ Source listing [NUL.LST ]: MYFILE ↓ Cross-reference [NUL.CRF]: MYFILE ↓ 50678 + 410090 Bytes symbol space free 0 Warning Errors 0 Severe Errors 其中劃線部分為用戶鍵入部分,MYFILE 為源程序名(MYFILE.ASM),方括號中是機器規(guī)定的默認文件名,如果用戶認為方括號內(nèi)的文件名就是要鍵入的文件名,則可只在劃線部分鍵入回車符。如果不想要列表文件和交叉索引文件,則可在 [NUL.LST ] 和 [NUL.CRF] 后不鍵入文件名只鍵入回車符。

      當(dāng)回答完上述四個詢問后,匯編程序就對源程序進行匯編。在匯編過程中,如果發(fā)現(xiàn)源程序中有語法錯誤,則提示出錯信息,指出是什么性質(zhì)的錯誤,錯誤類型,最后列出錯誤的總數(shù)。之后可重新進入屏幕編輯狀態(tài),調(diào)入源程序(MYFILE.ASM)進行修改,修改完畢,再進行匯編,直到匯編通過為止。

      如果在匯編時不需要產(chǎn)生列表文件(.LST)和交叉索引文件(.CRF),調(diào)用匯編程序時可用分號結(jié)束。如果需要產(chǎn)生.OBJ 和.LST 文件,不需要.CRF 文件,則在分號前面加兩個逗號即可。如果 4 個文件都需要,用簡便的操作方法是在分號前用了 3 個逗號。)列表文件(.LST)

      列表文件(.LST)是通過匯編程序(MASM)產(chǎn)生的,可以在 DOS 狀態(tài)下用 TYPE 命令顯示或打印該文件,以便分析調(diào)試源程序。如顯示 D 盤上已存在的列表文件 MYFILE.LST 操作方法如下: D> TYPE MYFILE.LST ;↓ 列表程序由三部分組成:(1)源程序和目標(biāo)程序清單

      列表程序同時列出源程序和對應(yīng)的機器語言清單。列表程序的第一列給出每條指令所在行號;第二列給出從段的首地址開始的每條指令存放的偏移地址;接著是數(shù)字列,給出對應(yīng)每條語句的機器碼和對應(yīng)于存放在棧段和數(shù)據(jù)段的值,在機器碼加上“ R ”的指令表示:這條指令在連接時可能產(chǎn)生與列出來的偏移地址不同的地址,因為這些偏移地址可能與其它模塊有關(guān);最右邊就是用匯編語言編寫的源程序。(2)段信息匯總表

      在段信息匯總表中列出該程序用了哪幾個段,如:代碼段 CODE、數(shù)據(jù)段 DATA 和堆棧段 STACK ;每個段所占存儲空間的長度(字節(jié)數(shù));每個段的定位類型,包括 PAGE(頁)、PARA(節(jié))、WORD(字)和 BYTE(字節(jié)),它們表示此段的起始邊界要求,即起始邊界地址應(yīng)分別可以被 256、16、2 和 1 除盡。該列表清單 中是以 PARA 為 CODE 段、DATA 段和 STACK 段的起始邊界地址。最后一列為段的組合類型;段的組合類型是告訴連接程序,本段與其它段的關(guān)系,組合類型有 NONE、PUBLIC、COMMOM、AT 表達式、STACK 和 MEMORY。NONE :表示本段與其它段不發(fā)生邏輯關(guān)系,即每段都有自己的基本地址。是隱含組合類型。

      STACK :表明連接程序首先要把本段與同名同類別的其它段相鄰地連接在一起,然后為所有定義為棧段的連接在一起的段,定義一個共同的段基地址,即連接成一個物理段。

      在列表程序的源程序中只有一個棧段,在棧段定義中給出了組合類型為 STACK,因此在段信息匯總表中列出了該項,在本程序中它沒有任何意義,因為沒有其它棧段與它連接,只是為了說明這個問題而設(shè)置的。(3)符號匯總表

      在列表程序中最后部分列出了符號匯總,是指在源程序中用戶定義的符號名、類型、值和所在段。

      如果在源程序中存在某些語法錯誤時,列表文件可提示某條語句有哪些錯誤,出錯提示顯示在出錯指令行的下面,因此用戶可借助列表文件很快地找到錯誤行,以便調(diào)試。另外由于列表文件給出了各條指令的偏移地址,對和程序時設(shè)置斷點很方便。)交叉索引文件(.CRF)

      匯編后產(chǎn)生的交叉索引文件,擴展名為.CRF, 它列出了源程序中定義的符號(包括:標(biāo)號、變量等)和程序中引用這些符號的情況。如果要查看這個符號表,必須使用 CREF.EXE 的文件,它根據(jù).CRF 文件建立一個擴展名為.REF 的文件,而后再用 DOS 的 TYPE 命令顯示,就可以看到這個符號使用情況表。具體操作方法如下: D> CREF ↓

      cref filename [.CRF] : MYFILE ↓ list filename [MYFILE.REF] : ↓ D> TYPE MYFILE.REF ↓

      目標(biāo)代碼鏈接程序----LINK.EXE

      用匯編語言編寫的源程序經(jīng)過匯編程序(MASM)匯編后產(chǎn)生了目標(biāo)程序(.OBJ),該文件是將源程序操作碼部分變成了機器碼,但地址是可浮動的相對地址(邏輯地址),因此必須經(jīng)過連接程序 LINK 連接后才能運行。連接程序 LINK 是把一個或多個獨立的目標(biāo)程序模塊裝配成一個可重定位的可執(zhí)行文件,擴展名為.EXE 文件。此外還可以產(chǎn)生一個內(nèi)存映象文件,擴展名為.MAP。1)連接程序執(zhí)行過程

      在 DOS 狀態(tài)下,鍵入 LINK ↓(或 LINK MYFILE ↓)則系統(tǒng)調(diào)入 LINK 程序,屏幕顯示操作如下: D> LINK ↓

      IBM Personal Computer Linker Version 2.00(C)Copyright IBM Corp 1981,1982,1983 Object Modules [.OBJ] : MYFILE ↓ Run File [MYFILE.EXE] : MYFILE ↓ List File [NUL.MAP] : MYFILE ↓ Libraries [.LIB] : ↓

      其中劃線部分為用戶鍵入部分,MYFILE 為源程序名,方括號內(nèi)為機器默認文件名,當(dāng)用戶認為方括號中的文件名就是要鍵入的文件名時,可在冒號后面只鍵入回車。

      其中 MAP 文件是否需要建立,由用戶決定,需要則鍵入文件名,不需要則直接送入一個回車鍵。

      最后一個詢問是問是否在連接時用到庫文件,對于連接匯編語言源程序的目標(biāo)文件,通常是不需要的,因此直接鍵入回車鍵。

      與匯編程序一樣,可以在連接時用分號結(jié)束后續(xù)詢問。例如:

      D> LINK MYFILE ;↓

      IBM Personal Computer Linker Version 2.00(C)Copyright IBM Corp 1981,1982,1983 連接后只產(chǎn)生 MYFILE.EXE 文件。如果除 MYFILE.EXE 文件外還要產(chǎn)生 MYFILE.MAP 文件,則在分號前加兩個逗號。D> LINK MYFILE,;↓ IBM Personal Computer Linker Version 2.00(C)Copyright IBM Corp 1981,1982,1983 2)內(nèi)存映象文件(.MAP)

      由連接程序 LINK 產(chǎn)生的擴展名為.MAP 文件,它實際上是連接程序的列表文件,它給出了每個段的地址分配情況及長度。

      在 DOS 狀態(tài)下,用 TYPE 命令顯示打印出來。例如: D> TYPE MYFILE.MAP ↓ Start Stop Length Name Class 00000H 0000FH 0010H DATA 00010H 0004FH 0040H STACK 00050H 0005FH 0010H CODE Origin Group Program entry point at 0005:0000 從中可以看到,源程序 MYFILE 中定義了三個段:數(shù)據(jù)段(DATA)起始地址為 00000H,終止地址為 0000FH,長度為 0010H 個字節(jié);堆棧段(STACK)起始地址為 00010H,終止地址為 0004FH,長度為 0040H 個字節(jié);代碼段(CODE)起始地址為 00050H,終止地址為 0005FH,長度為 0010H 個字節(jié)。

      應(yīng)用程序執(zhí)行

      當(dāng)用連接程序 LINK 將目標(biāo)程序(.OBJ)連接定位后,可產(chǎn)生可執(zhí)行的應(yīng)用程序文件(.EXE),可以在 DOS 狀態(tài)下執(zhí)行該程序。執(zhí)行操作如下: D> MYFILE ↓ 或 D> MYFILE.EXE ↓

      在源程序 MYFILE 中如果有顯示結(jié)果的指令,則在執(zhí)行程序后可以看到執(zhí)行結(jié)果;如需要動態(tài)調(diào)試應(yīng)用程序 MYFILE.EXE,則可以借助動態(tài)調(diào)試程序 DEBUG.COM 來進行調(diào)試、運行,DEBUG 是一種支持命令行方式的匯編語言編程調(diào)試工具。

      動態(tài)調(diào)試程序 DEBUG.COM 在編寫和運行匯編程序的過程中,會遇到一些錯誤和問題,需要對程序進行分析和調(diào)試,調(diào)試程序 DEBUG 就是專為匯編語言設(shè)計的一種調(diào)試工具。它在調(diào)試匯編語言程序時有很強的功能,能使程序設(shè)計者接觸到機器內(nèi)部,能觀察和修改寄存器和存儲單元內(nèi)容,并能監(jiān)視目標(biāo)程序的執(zhí)行情況,使用戶真正接觸到 CPU 內(nèi)部,與計算機產(chǎn)生最緊密的工作聯(lián)系。

      動態(tài)和程序 DEBUG 的主要特點 DEBUG 的執(zhí)行 DEBUG 命令格式 主要 DEBUG 命令

      動態(tài)和程序 DEBUG 的主要特點)能夠在最小環(huán)境下運行匯編程序

      在 DOS 狀態(tài)下運行匯編程序,必須將程序經(jīng)過 MASM 匯編程序,而后還要經(jīng)過 LINK 連接程序產(chǎn)生可執(zhí)行程序,才能最終運行,比較麻煩。在 DEBUG 狀態(tài)下,為用戶提供了調(diào)試、控制測試的環(huán)境,可以在此環(huán)境下進行編程、調(diào)試、監(jiān)督、執(zhí)行用戶編寫的匯編程序。因此調(diào)試周期短,為用戶提供了極大的方便。2)提供極簡單的修改手段

      DEBUG 提供了修改命令,可以修改內(nèi)存單元內(nèi)容,修改寄存器的內(nèi)容,為調(diào)試程序、修改程序帶來了方便。3)提供用戶與計算機內(nèi)部聯(lián)系的窗口

      DEBUG 具有顯示命令,它既可以使用戶看到某內(nèi)存單元或某一塊單元內(nèi)容,也可以看到 CPU 內(nèi)部各寄存器的內(nèi)容。用單步執(zhí)行命令實現(xiàn)跟蹤執(zhí)行,每執(zhí)行一步都使用戶看到各寄存器的內(nèi)容的變化,以便分析和調(diào)整程序。4)可裝入、修改或顯示任何文件

      當(dāng)然在 DEBUG 狀態(tài)下運行匯編程序也具有一定局限性。在 DEBUG 狀態(tài)下運行的程序不能使用宏匯編程序中的宏指令,大部分偽指令也不能使用,因此只能把程序分段調(diào)試。此外,不能調(diào)試太長的程序,只能分塊進行中程序設(shè)計。在 DEBUG 狀態(tài)下調(diào)試好的程序不能形成可執(zhí)行文件(.EXE),因此調(diào)試好的程序只能記下,到編輯環(huán)境下重新鍵入調(diào)試好的程序,通過匯編程序(如 MASM),再通過連接程序(LINK)形成可執(zhí)行文件(.EXE)。

      DEBUG 的執(zhí)行

      在操作系統(tǒng)(DOS 或 WIndows)命令行方式下,直接調(diào)入 DEBUG 程序,鍵入命令的格式如下: D>DEBUG [d:][Path][filename[.ext]][Parm1][Parm2] 其中 [] 的內(nèi)容為可選項,可以有也可以缺省。

      [d:] 為驅(qū)動器號,指要調(diào)入 DEBUG 狀態(tài)的可執(zhí)行文件在哪個驅(qū)動器中,如 A:、B:、C: 等。[Path] 為路徑,指要調(diào)入 DEBUG 狀態(tài)的可執(zhí)行文件是在哪個目錄下或子目錄下。

      [filename[.ext]],指要調(diào)入 DEBUG 狀態(tài)下的可執(zhí)行文件的文件名,該文件可以是通過編輯、匯編、連接后產(chǎn)生的可執(zhí)行文件,也可以是在 DEBUG 狀態(tài)下匯編的程序 段,通過寫盤命令 W 寫入磁盤的文件。[Parm1][Parm2] 為任選參數(shù),是給定文件的說明參數(shù)。

      在啟動 DEBUG 時,如果輸入 filename(文件名),則 DEBUG 程序把指定文件裝入內(nèi)存,用戶可以通過 DEBUG 的命令對指定文件進行修改、顯示或執(zhí)行。如果沒有文件名,則是以當(dāng)前內(nèi)存的內(nèi)容工作,或者用命名命令或裝入命令把需要的文件裝入內(nèi)存,然后再通過 DEBUG 命令進行修改、顯示或執(zhí)行。當(dāng)啟動 DEBUG 程序后,屏幕上出現(xiàn)“—”,說明系統(tǒng)已進入 DEBUG 狀態(tài)。DEBUG 命令格式(1)DEBUG 命令都是一個英文字母,后面跟著一個或多個有關(guān)參數(shù)。多個操作參數(shù)之間用“ , ”或空格隔開。(2)DEBUG 命令必須接著按 ENTER 鍵,命令才有效。

      (3)參數(shù)中不論是地址還是數(shù)據(jù),均用十六進制數(shù)表示,但十六進制數(shù)據(jù)后面不要用“ H ”。(4)可以用 Ctrl 和 Break 鍵來停止一個命令的執(zhí)行,返回到 DEBUG 的提示符“—”下。(5)用 Ctrl - Num Lock 鍵中止正在上卷的輸出行,再通過按任意鍵繼續(xù)輸出信息。主要 DEBUG 命令

      (1)匯編命令 A

      格式: a.A [ 段寄存器名 ]:[ 偏移地址 ] b.A [ 段地址 ]:[ 偏移地址 ] c.A [ 偏移地址 ] d.A 功能:用該命令可以將匯編語言程序直接匯編進入內(nèi)存。

      當(dāng)鍵入 A 命令后,顯示段地址和偏移地址等待用戶鍵入?yún)R編指令,每鍵入一條匯編指令回車后,自動顯示下一條指令的段地址和偏移地址,再鍵入下一條匯編指令,直到匯編語言程序全部鍵入,又顯示下一地址時可直接鍵入回車返回到提示符“-”為止。

      其中 a 的段地址在段地址寄存器中,因此在使用該命令時必須將段地址寄存器送入段地址,c 的地址在 CS 中,d 的段地址在 CS 中,偏移地址為 100H。

      (2)顯示內(nèi)存命令 D 格式: a.D [ 地址 ] b.D [ 地址范圍 ] c.D 功能:顯示指定內(nèi)存范圍的內(nèi)容。

      顯示的內(nèi)容為兩種形式:一種為十六進制內(nèi)容,一種為與十六進制相對應(yīng)的 ASCII 碼字符,對不可見字符以“·”代替。

      對于 a、c 每次顯示 128 個字節(jié)內(nèi)容,b 顯示的字節(jié)數(shù)由地址范圍來決定。

      若命令中有地址,則顯示的內(nèi)容從指定地址開始,若中中無地址(如 c)則從上一個 D 命令所顯示的最后一個單元的下一個單元開始。若以前沒有使用過 D 命令,則以 DEBUG 初始化的段寄存器的內(nèi)容為起始段地址,起始偏移地址為 100H,即 CS:100。

      對于 a 中的地址為偏移地址,段地址為 CS 的內(nèi)容,對 b 中的地址范圍,可以指定段地址和起始偏移地址和終止偏移地址。

      (3)修改存儲單元內(nèi)容命令 E 格式: a · E [ 地址 ] [ 內(nèi)容表 ] b · E [ 地址 ] 功能: a ·用命令所給定的內(nèi)容表去代替指定地址范圍的內(nèi)存單元內(nèi)容。b ·一個單元一個單元地連續(xù)修改單元內(nèi)容。

      其中:內(nèi)容表為一個十六進制數(shù),也可以是用單引號括起的一串字符。

      (4)填充內(nèi)存命令 F

      格式: F [ 范圍 ][ 單元內(nèi)容表 ] 功能:將單元內(nèi)容表中的內(nèi)容重復(fù)裝入內(nèi)存的指定范圍內(nèi)。

      (5)內(nèi)存搬家命令 M

      格式: M [ 源地址范圍 ][ 目標(biāo)起始地址 ] 其中源地址范圍和目的起始地址為偏移地址,段地址為 DS 的內(nèi)容。功能:把源地址范圍的內(nèi)容搬至以目標(biāo)起始地址開始的存儲單元中。

      (6)比較命令 C

      格式: C [ 源地址范圍 ],[ 目標(biāo)地址 ] 其中源地址范圍是由起始地址和終止地址指出的一片連續(xù)的存儲單元,目標(biāo)地址為與源地址所指單元對比的目標(biāo)地址起始地址。功能:從源地址范圍是由起始的地址單元開始逐個與目標(biāo)起始地址往后的單元順序比較每個單元內(nèi)容,比較到源終止地址為止。比較結(jié)果如果一致則不顯示任何信息,如果不一致,則以 [ 源地址 ][ 源內(nèi)容 ][ 目的內(nèi)容 ][ 目的地址 ] 的形式顯示失敗單元地址及內(nèi)容。

      (7)搜索指定內(nèi)容命令 S 格式: S [ 地址范圍 ][ 表 ] 功能:在指定地址范圍內(nèi)搜索表中內(nèi)容,搜索到就顯示表中元素所在地址。

      (8)檢查和修改寄存器內(nèi)容命令 R 格式: a · R b · R [ 寄存器名 ] 功能: a ·顯示 CPU 內(nèi)部所有寄存器的內(nèi)容和全部標(biāo)志位的狀態(tài)。b ·顯示和修改一個指定寄定器的內(nèi)容和標(biāo)志位的狀態(tài)。

      其中對狀態(tài)標(biāo)志寄存器 FLAG 以位的形式顯示,顯示時,8 個狀態(tài)標(biāo)志的顯示次序和符號如表 B - 1 所示。表 B - 1 狀態(tài)標(biāo)志顯示形式

      標(biāo) 志 位 溢出標(biāo)志 OF 方向標(biāo)志 DF 中斷標(biāo)志 IF 符號標(biāo)志 SF 零標(biāo)志 ZF 輔助進位 AF 奇偶標(biāo)志 PF 進位標(biāo)志 CF

      (9)跟蹤與顯示命令 T

      格式: a · T[ =地址 ] 或 T [ 地址 ] b · T[ =地址 ][ 條數(shù) ] 或 T [ 地址 ][ 條數(shù) ] 功能: a ·執(zhí)行一條指定地址處的指令,停下來,顯示 CPU 所有寄存器內(nèi)容和全部標(biāo)志位的狀態(tài),以及下一條指令的地址和內(nèi)容。

      b ·為多條跟蹤命令,從指定地址開始;若命令中用 [ 地址 ] 給定了起始地址,則從起始地址開始,若未給定,則從當(dāng)前地址(CS:IP)開始,執(zhí)行命令中的 [ 條數(shù) ] 決定一共跟蹤幾條指令后返回 DEBUG 狀態(tài)。

      (10)反匯編命令 U 格式: a · U [ 地址 ] b · U [ 地址范圍 ] 功能:將指定范圍內(nèi)的代碼以匯編 語言形式顯示,同時顯示該代碼位于內(nèi)存的地址和機器。

      若在命令中沒有指定地址則以上一個 U 命令的最后一條指令地址的下一個單元作為起始地址;若沒有輸入過 U 命令,則以 DEBUG 初始化段寄存器的值作為段地址,以 0100H 作為偏移地址。

      (11)命名命令 N 格式: N 文件名

      功能:在調(diào)用 DEBUG 時,沒有文件名,則需要用 N 命令將要調(diào)用的文件名格式化到 CS:5CH 的文件控制塊中,才能用 L 命令把它調(diào)入內(nèi)存進行調(diào)試(其它形式參考 DOS 手冊)。

      (12)讀盤命令 L

      格式: a · L [ 地址 ][ 驅(qū)動器號 ][ 起始扇區(qū)號 ][ 所讀扇區(qū)個數(shù) ] b · L [ 地址 ] c · L 功能: a ·把指定驅(qū)動器和指定扇區(qū)范圍的內(nèi)容讀到內(nèi)存的指定區(qū)域中。其中地址是讀入內(nèi)存的起始地址,當(dāng)輸入時沒有給定地址,則隱含地址為 CS:100H。起始扇區(qū)號指邏輯扇區(qū)號的起始位置。所讀扇區(qū)個數(shù)是指從起始扇區(qū)號開始讀到內(nèi)存幾個扇區(qū)的內(nèi)容。驅(qū)動器號為 0 或 1,0 表示 A 盤,1 表示 B 盤。

      b ·讀入已在 CS:5CH 中格式化的文件控制塊所指定的文件。在使用該命令前用 N 命令命名即可將要讀入的文件名格式化到 CS:5CH 的文件控制塊中,其中地址為內(nèi)存地址。

      狀 態(tài) 有 / 無 增 / 減 開 / 關(guān) 負 / 正 零 / 非 有 / 無 偶 / 奇 有 / 無

      顯示形式(置位 / 復(fù)位)

      OV/NV DN/UP EI/DI NG/PL ZR/NZ AC/NA PE/PO CY/NC c ·同 b ·地址隱含在 CS : 100H 中。

      當(dāng)讀入的文件有擴展名.COM 或.EXE,則始終裝入 CS:100H 中,命令中指定了地址也沒用。其中 BX 和 CX 中存放所讀文件的字節(jié)數(shù)。

      (13)寫盤命令 W

      格式: a · W[ 地址 ][ 驅(qū)動器號 ][ 起始扇區(qū)號 ][ 所寫扇區(qū)個數(shù) ] b · W[ 地址 ] c · W 功能: a · 把在 DEBUGU 狀態(tài)下調(diào)試的程序或數(shù)據(jù)寫入指定的驅(qū)動器中 , 起始扇區(qū)號 , 所寫扇區(qū)個數(shù)為要占盤中幾個扇區(qū)。

      寫盤指定扇區(qū)的操作應(yīng)十分小心,如有差錯將會破壞盤上的原有內(nèi)容。如果在命令行中的地址只包含偏移地址,W 命令認為段地址在 CS 中。

      b ·當(dāng)鍵入不帶參數(shù)的寫盤命令時,(或只鍵入地址參數(shù)的寫盤命令),寫盤命令把文件寫到軟盤上。該文件在用 W 命令之前用命名命令 N 將文件格式化在 CS:5CH 的文件控制塊中。c ·只有 W 命令以前而沒有任何參數(shù)時,與 N 配合使用進行寫盤操作。在用 W 命令以前在 BX 和 CX 中應(yīng)寫入文件的字節(jié)數(shù)。

      (15)輸出命令 O

      格式: O[ 端口地址 ] [ 字節(jié)值 ] 功能:向指定端口地址輸出一個字節(jié)。

      (16)運行命令 G

      格式: G [ =地址 ][ 地址 [ 地址… ]] 功能:執(zhí)行用戶正在調(diào)試的程序。

      其中地址為執(zhí)行的起始地址,以 CS 中內(nèi)容作為段地址,以等號后面的地址為偏移地址。再后面的地址為斷點地址。在命令行中只有起始地址,沒有斷點地址,則程序在執(zhí)行時不中斷。DEBUG 規(guī)定最多設(shè)置 10 個斷點地址。設(shè)置多個斷點用于調(diào)試較大的程序,即程序中有多個模塊、多個通路時用,比較方便,在執(zhí)行時不論走哪條通路,程序都可以在斷點處停下來,以便調(diào)整程序。

      斷點地址為程序中斷處的偏移地址,段地址在 CS 中。

      當(dāng)執(zhí)行在 DEBUG 狀態(tài)下匯編的小段程序時,只用 G 命令即可。

      (17)十六進制運算命令 H 格式: H 數(shù)據(jù) 1 數(shù)據(jù) 2 其中數(shù)據(jù) 1 和數(shù)據(jù) 2 為十六進制數(shù)據(jù)。

      功能:將兩個十六進制數(shù)進行相加、減,結(jié)果顯示在屏幕上。(18)結(jié)束 DEBUG 返回到 DOS 命令 Q 格式: Q 功能:程序調(diào)試完退出 DEBUG 狀態(tài),返回到 DOS 狀態(tài)下。

      Q 命令不能把內(nèi)存的文件存盤,要想存盤必須在退出 DEBUG 之前用 W 命令寫盤

      讀書的好處

      1、行萬里路,讀萬卷書。

      2、書山有路勤為徑,學(xué)海無涯苦作舟。

      3、讀書破萬卷,下筆如有神。

      4、我所學(xué)到的任何有價值的知識都是由自學(xué)中得來的。——達爾文

      5、少壯不努力,老大徒悲傷。

      6、黑發(fā)不知勤學(xué)早,白首方悔讀書遲?!佌媲?/p>

      7、寶劍鋒從磨礪出,梅花香自苦寒來。

      8、讀書要三到:心到、眼到、口到

      9、玉不琢、不成器,人不學(xué)、不知義。

      10、一日無書,百事荒廢?!悏?/p>

      11、書是人類進步的階梯。

      12、一日不讀口生,一日不寫手生。

      13、我撲在書上,就像饑餓的人撲在面包上?!郀柣?/p>

      14、書到用時方恨少、事非經(jīng)過不知難?!懹?/p>

      15、讀一本好書,就如同和一個高尚的人在交談——歌德

      16、讀一切好書,就是和許多高尚的人談話?!芽▋?/p>

      17、學(xué)習(xí)永遠不晚?!郀柣?/p>

      18、少而好學(xué),如日出之陽;壯而好學(xué),如日中之光;志而好學(xué),如炳燭之光?!獎⑾?/p>

      19、學(xué)而不思則惘,思而不學(xué)則殆。——孔子

      20、讀書給人以快樂、給人以光彩、給人以才干?!喔?/p>

      下載用VHDL語言編寫的數(shù)字鐘程序5篇word格式文檔
      下載用VHDL語言編寫的數(shù)字鐘程序5篇.doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進行舉報,并提供相關(guān)證據(jù),工作人員會在5個工作日內(nèi)聯(lián)系你,一經(jīng)查實,本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        VHDL實現(xiàn)數(shù)字鐘課設(shè)報告[推薦]

        東北大學(xué)信息學(xué)院 課程設(shè)計報告 課程設(shè)計題目:用VHDL語言實現(xiàn)數(shù)字鐘的設(shè)計 班 級:電子1001班 學(xué) 號:20102594 姓 名:劉云飛 指導(dǎo)老師:李世平、李寧設(shè)計時間:2012年12月1 東北大......

        基于VHDL的多功能數(shù)字鐘設(shè)計報告

        基于VHDL的多功能數(shù)字鐘 設(shè)計報告 021215班 衛(wèi)時章 02121451 一、設(shè)計要求 1、具有以二十四小時制計時、顯示、整點報時、時間設(shè)置和鬧鐘的功能。 2、設(shè)計精度要求為1秒。......

        用狀態(tài)機實現(xiàn)的EDA多功能數(shù)字鐘課程設(shè)計VHDL代碼

        設(shè)計并實現(xiàn)具有一定功能的數(shù)字鐘 1、該數(shù)字鐘可以實現(xiàn)3個功能:計時功能、整點報時功能和重置時間功能,因此有3個功能:計時、重置時間、復(fù)位。 2、對所有設(shè)計的小系統(tǒng)能夠正確分......

        eda數(shù)字鐘程序

        LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY clock IS PORT (EN :IN STD_LOGIC;數(shù)碼管使能 CL......

        數(shù)字電路課程設(shè)計——用VHDL語言設(shè)計交通燈(五篇)

        數(shù)字電路課程設(shè)計報告 院系: 電氣信息工程學(xué)院 班級: 08測控2班 學(xué)號: 08314237 姓名: 董 亮 合作: 虞 波 指導(dǎo)教師: 翟 麗 芳 2010年12月10日 第 0 頁 共 17 頁 目 錄 引言··......

        數(shù)字鐘課程設(shè)計程序(精選5篇)

        #includevoid chuanshu(void); void shuchu(void); void saomiao(void); void delay (void);unsigned int t; unsigned char m; unsigned char shi,fen,miao;unsigned char......

        第2章用c語言編寫簡單程序?qū)嵱?xùn)綜合練習(xí)

        第2章用c語言編寫簡單程序?qū)嵱?xùn)綜合練習(xí)實驗?zāi)康?1) 使用if語句計算分段函數(shù) 2) 熟練掌握for語句和while語句編寫簡單的循環(huán)程序 3) 學(xué)習(xí)簡單的程序調(diào)試方法編程題 1. 編寫程......

        VHDL語言EDA四人搶答器

        一.EDA技術(shù)簡介 在計算機技術(shù)的推動下,20世紀末,電子技術(shù)獲得了飛速的發(fā)展,現(xiàn)代電子產(chǎn)品幾乎滲透了社會的各個領(lǐng)域,有力地推動了社會生產(chǎn)力的發(fā)展和社會信息化程度的提高,同時也使......