【文章內(nèi)容簡(jiǎn)介】
tor(3 downto 0)。秒的個(gè)位 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=39。139。1Hz count=0。 beep=39。139。 elsif count5999999 then beep=39。039。 2Hz else clk1=39。039。 end if。 if counf=11999 then clkk=39。139。1000HZ counf=0。 else clkk=39。039。 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。秒個(gè)位s220:process(clk1,cj) begin if clk139。event and clk1=39。139。 then if sec2=1001 then 其中sec2是秒的個(gè)位 sec2=0000。 elsif cj=010 then sec2=sec2。 else sec2=sec2+1。 end if。 end if。 if cj=001 then sec2=0000。 秒個(gè)位復(fù)位 end if。end process s220。秒十位s110:process(clk1,cj) begin if clk139。event and clk1=39。139。 then if (sec1=0101 and sec2=1001)then其中sec1是秒鐘的十位 sec1=0000。 elsif cj=010 then sec1=sec1。 else if sec2=1001then sec1=sec1+1。 end if。 end if。 end if。 if cj=001 then sec1=0000。 秒十位復(fù)位 end if。end process s110。分鐘個(gè)位m220:process(clk1,sec1,sec2,cj) begin if clk139。event and clk1=39。139。 then if min2=1001and (sec1=0101 and sec2=1001)then其中min2是分鐘的個(gè)位 min2=0000。 elsif min2=1001and (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 clk139。event and clk1=39。139。 then if (min1=0101 and min2=1001) and (sec1=0101 and sec2=1001)then min1=0000。 elsif min1=0101and min2=1001and (cj=011 and cj=100)then min1=0000。 elsif (min2=1001and (sec1=0101 and sec2=1001)) or (min2=1001and 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。小時(shí)個(gè)位h220:process(clk1,min1,min2,sec1,sec2,cj,hou1) begin if clk139。event and clk1=39。139。 then if (hou1=0010 and hou2=0011)and(min1=0101 and min2=1001) and (sec1=0101 and sec2=1001) then hou2=0000。 elsif hou2=1001and(min1=0101 and min2=1001) and (sec1=0101 and sec2=1001) then hou2=0000。 elsif (hou2=1001and cj=11