【文章內(nèi)容簡介】
td_logic_vector(6 downto 0)。 signal hour_daout:std_logic_vector(5 downto 0)。 signal seltime_daout:std_logic_vector(3 downto 0)。 signal ledout:std_logic_vector(6 downto 0)。 begin a=ledout(6)。b=ledout(5)。c=ledout(4)。d=ledout(3)。 e=ledout(2)。f=ledout(1)。g=ledout(0)。 u1:second port map(reset=reset, clk=clk, setmin=setmin, enmin=enmin_re, daout=second_daout)。 u2:minute port map(clk=enmin_re, clk1=clk, reset=reset, sethour=sethour, enhour=enhour_re, daout=minute_daout)。 u3:hour port map(clk=enhour_re, reset=reset, daout=hour_daout)。 u4:alert port map(clk=clk, dain=minute_daout, speak=speaker, lamp=lamp)。 u5:seltime port map(clk=clkdsp, reset=reset, sec=second_daout, min=minute_daout, hour=hour_daout, daout=seltime_daout, dp=dpout, sel=sel)。 u6:deled port map(num=seltime_daout, led=ledout)。 end a。 7 、秒計數(shù)器( ) 為底層文本 LIBRARY ieee。 use 。 use 。 ENTITY second IS PORT( clk,reset,setmin:IN STD_LOGIC。 enmin:OUT STD_LOGIC。 daout:out std_logic_vector(6 downto 0))。 END entity second。 ARCHITECTURE fun OF second IS SIGNAL count:STD_LOGIC_VECTOR(6 downto 0)。 SIGNAL enmin_1,enmin_2:STD_LOGIC。 BEGIN daout=count。 enmin_2=(enmin_1 or enmin_2)。 enmin=(enmin_1 or enmin_2)。 process(clk,reset,setmin) begin if(reset=39。039。)then count =0000000。 elsif(clk39。event and clk=39。139。)then if(count(3 downto 0)=1001)then if(count=1660)then if(count=1011001)then enmin_1=39。139。count=0000000。 else count=count+7。 end if。 else count=0000000。 end if。 elsif(count1660)then count=count+1。 enmin_1=39。139。after 100 ns。 else