【文章內(nèi)容簡(jiǎn)介】
then m=m+1。 if(m=1001)then m=0000。 n=n+1。 end if。 end if。 if(c=01011001)then n=0000。 m=0000。 end if。 case c is when 01011001=enhour=39。139。 when others=enhour=null。 end case。 end process。 mgewei=m。 mshiwei=n。end architecture rtl。其模塊仿真圖為: 時(shí)計(jì)數(shù)模塊library ieee。use 。use 。entity hour is port(clk,rst:in std_logic。 hshiwei:out std_logic_vector(3 downto 0)。 hgewei:out std_logic_vector(3 downto 0))。end entity hour。architecture rtl of hour issignal p,q:std_logic_vector(3 downto 0)。 begin process(clk,rst) begin if(rst=39。139。)then p=0000。 q=0000。 elsif(clk39。event and clk=39。139。)then p=p+1。 if(p=1001)then p=0000。 q=q+1。 end if。 end if。 if(q