【文章內(nèi)容簡介】
b=39。039。 when00001001=a=39。039。b=39。139。 when00010000=a=39。039。b=39。039。 when00010001=a=39。039。b=39。139。 when00010010=a=39。039。b=39。039。 when others=null。 end case。 end process。 m1=q1。m2=q2。end。 (5)年低兩位計(jì)數(shù)器程序及仿真圖如下:library ieee。use 。use 。entity year is port(clk:in std_logic。 y1,y2:out std_logic_vector(3 downto 0)。 run,cout:out std_logic)。end year。architecture one of year is signal q1,q2,q3:std_logic_vector(3 downto 0)。begin process(clk) begin if clk39。event and clk=39。139。 then q1=q1+1。 if q1=9 then q1=(others=39。039。)。 q2=q2+1。 end if。 if q2=9 and q1=9 then q2=0000。q1=0000。cout=39。139。 else cout=39。039。 end if。 end if。 end process。 process(clk) begin if clk39。event and clk=39。139。 then q3=q3+1。 if q3=3 then q3=(others=39。039。)。 run=39。139。 else run =39。039。 end if。 end if。 y1=q1。y2=q2。 end process。 end。 (6)年高兩位計(jì)數(shù)器程序及仿真圖如下:library ieee。use 。use 。entity year1 is port(clk:in std_logic。 y3,y4:out std_logic_vector(3 downto 0)。 run,cout:out std_logic)。end year1。architecture one of year1 is signal q1,q2:std_logic_vector(3 downto 0)。begin process(clk) begin if clk39。event and clk=39。139。 then q1=q1+1。 if q1=9 then q1=(others=39。039。)。 q2=q2+1。 end if。 if q2=9 and q1=9 then q2=0000。q1=0000。cout=39。139。 else cout=39。039。 end if。 end if。 end process。 process(q1) begin if q1(1 downto 0)/=00 then run=39。139。 else run =39。039。 end if。 y3=q1。y4=q2。 end process。 end。 (7)星期計(jì)數(shù)器程序及仿真圖如下:library ieee。use 。use 。entity t7 is port(clk:in std_logic。 q1,q2:out std_logic_vector(3 downto 0))。end t7。archite