【正文】
sec2=0101) then 12 xiaoshi 59fen 50miao case sec1 is mingjiao 2ci 1 gao 1 di 9 4 when 0000= flag1k:=39。flag1k:=39。 else flag500:=39。039。039。139。139。139。139。139。139。 begin if clk1s39。 variable flag1k :std_logic。 end。 hou2,hou1:in std_logic_vector(3 downto 0)。 中南大學信息院自動化梁雪林設計 sec2,sec1:in std_logic_vector(3 downto 0)。 clk500:in std_logic。 use 。 use 。 end。 end if。 else hou1=hou1+1。 elsif (hou1=1001) then hou1=0000。 then if (hou1=0011and hou2=0010) then hou1=0000。event and clky=39。 end process。else clky=clkh。139。 Architecture A of hour1 is signal clky : std_logic。 hou2,hou1:buffer std_logic_vector(3 downto 0) )。 clk1s: in std_logic。 中南大學信息院自動化梁雪林設計 use 。 use 。 end。 end if。039。 else min1=min1+1。 中南大學信息院自動化梁雪林設計 minco=39。 elsif (min1=1001) then min1=0000。 minco=39。 then if(min1=1001 and min2=0101) then min1=0000。event and clkx=39。 end process。 else clkx=clkm。139。 Architecture A of minute1 is signal clkx:std_logic。 fengzhong gaodiwei minco: out std_logic fengzhong jinwei )。 jiao feng xinhao setm:in std_logic。 entity minute1 is port( clkm:in std_logic。 use 。 三、時序仿真: 中南大學信息院自動化梁雪林設計 四、功能說明: 對輸入 1Hz 的頻率進行計數(shù),用 reset 進行復位清零; 只有 reset 為高時才開始計數(shù);輸出 2 組 4 位的 BCD 碼,用于數(shù)碼管顯示;達到 59s 時輸出進 位信號色 sec0; 分計時器模塊設計 一、原理圖設計: 中南大學信息院自動化梁雪林設計 二、 源代碼: library ieee。 end process。 end if。 zhengchangjishu 1s sec0=39。039。 sec2=sec2+1。139。 sec1=0000。139。 elsif clk1s39。 sec0=39。 then qing ling sec1=0000。 Architecture A of second1 is begin process(clk1s,reset) begin if reset=39。miao gaodiwei sec0:out std_logic miao jinwei )。 reset: in std_logic。 use 。 use 。 三、 時序仿真圖: 四、功能說明 通過對輸入時鐘上升沿進行計數(shù),以計數(shù)的溢出值 F1k、 F500、 F1 的上升沿對計數(shù)器輸出進行取反操作。 end process。 end if。 else clk1hz=39。 then clk1hz=39。 中南大學信息院自動化梁雪林設計 if t23=39。139。 if F139。 end if。 else clk500=39。 then clk500=39。 if t22=39。139。 if F50039。 end if。 else clk1k=39。 then clk1k=39。 if t2=39。139。 begin if F1k39。 variable t22:std_logic。 end process。 111000=8 fen ping end if。F1=39。t13:=000000000000。 if t13=111110011111 then F1=39。039。 1100=4 fen ping else t12:=t12+1。139。 111000=8 fen ping end if。F1k=39。t1:=00。event then if t1=11 then F1k=39。139。 variable t13:std_logic_vector(11 downto 0)。 begin p1:process(clk) variable t1:std_logic_vector(1 downto 0)。 signal F500:std_logic。 End。 clk500: OUT STD_LOGIC。 Entity fenp IS Port( clk : IN STD_LOGIC。 Use 。當計數(shù)器的各位呈現(xiàn)特定的電平時,可以選通特定的與門和或門,將指定的頻率信號送入蜂鳴器中,實現(xiàn)在規(guī)定的時刻以指定頻率發(fā)音報時。正常情況下,開關不影響脈沖輸入即秒正