【文章內(nèi)容簡介】
nto 0)。 BCDOut : out std_logic_vector(7 downto 0) )。 end ponent。 BEGIN process(mode) begin if (clr=39。139。) then state=00。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 15 15 else if (mode39。event and mode=39。139。) then state=state+1。 end if。 end if。 end process。 process(state, blink_clk) begin case state is when 00 = blink=000。 when 01 = blink=(2=blink_clk, others=39。039。)。 when 10 = blink=(1=blink_clk, others=39。039。)。 when 11 = blink=(0=blink_clk, others=39。039。)。 end case。 end process。 process(Mon, Year,d) begin case Mon is when 000001 = d=011111。 when 000010 = case Year is 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 16 16 when 010000 = d=011101。 when 010100 = d=011101。 when 011000 = d=011101。 when 011100 = d=011101。 when 100000 = d=011101。 when 100100 = d=011101。 when 101000 = d=011101。 when 101100 = d=011101。 when 110000 = d=011101。 when 110100 = d=011101。 when 111000 = d=011101。 when 111100 = d=011101。 when others = d=011100。 end case。 when 000011 = d=011111。 when 000100 = d=011110。 when 000101 = d=011111。 when 000110 = d=011110。 when 000111 = d=011111。 when 001000 = d=011111。 when 001001 = d=011110。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 17 17 when 001010 = d=011111。 when 001011 = d=011110。 when 001100 = d=011111。 when others = d=011110。 end case。 end process。 process(clk) variable blink_t: std_logic_vector(13 downto 0)。 begin if (clr=39。139。) then blink_clk=39。039。 blink_t:=(others=39。039。)。 else if (clk39。event and clk=39。139。) then if (blink_t=11000011010011) then blink_t:=(others=39。039。)。 blink_clk=not blink_clk。 else blink_t:=blink_t+1。 end if。 end if。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 18 18 end if。 end process。 process(clk, state) variable clk_t: std_logic_vector(16 downto 0)。 begin if (clr=39。139。) then Hour=000000。 Min=000000。 Sec=000000。 Year=000000。 Mon=000000。 Day=000000。 clk_t:=(others=39。039。)。set_reg=39。039。 else if (clk39。event and clk=39。139。) then case state is when 00 = if (clk_t=11000011010011111) then clk_t:=(others=39。039。)。 if (Sec=59) then Sec=(others=39。039。)。 if (Min=59) then Min=(others=39。039。)。 if (Hour=23) then Hour=(others=39。039。)。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 19 19 if (Day=d) then Day=000001。 if (Mon=12) then Mon=000001。 if (Year=63) then Year=000001。 else Year=Year+1。 end if。 else Mon=Mon+1。 end if。 else Day=Day+1。 end if。 else Hour=Hour+1。 end if。 else Min=Min+1。 end if。 else Sec=Sec+1。 end if。 else clk_t:=clk_t+1。 end if。 when 01 = 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 20 20 if(k=39。139。)then if (set=39。139。) then if set_reg=39。039。 then set_reg=39。139。 if (Year=63) then Year=000001。 else Year=Year+1。 end if。 end if。 else set_reg=39。039。 end if。 else if (set=39。139。) then if set_reg=39。039。 then set_reg=39。139。 if (Hour=23) then Hour=(others=39。039。)。 else Hour=Hour+1。 end if。 end if。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 21 21 else set_reg=39。039。 end if。 end if。 when 10 = if(k=39。139。)then if (set=39。139。) then if set_reg=39。039。 then set_reg=39。139。 if (Mon=12) then Mon=000001。 else Mon=Mon+1。 end if。 end if。 else set_reg=39。039。 end if。 else if (set=39。139。) then if set_reg=39。039。 then set_reg=39。139。 內(nèi)蒙古大學(xué) 鄂爾多斯學(xué)院 11 級自動化專業(yè) 22 22 if (Min=59) then Min=(others=39。039。)。 else Min=Min+1。