【正文】
end if。 else if(q=1001) then q=0000。 else q=q+1。 end if。 end if。 else q=q。 end if。 end if。 end if。 end process。END jishu_architecture。(7)jishu2LIBRARY ieee。USE 。use 。ENTITY jishu2 IS PORT ( clk : IN STD_LOGIC。 q : buffer STD_LOGIC_VECTOR(1 downto 0) )。END jishu2。ARCHITECTURE jishu2_architecture OF jishu2 ISBEGIN process(clk) begin if(clk39。event and clk=39。139。) then if(q=11) then q=00。 else q=q+1。 end if。 end if。 end process。END jishu2_architecture。(8)xianshiLIBRARY ieee。USE 。use 。ENTITY xianshi IS PORT ( a : IN STD_LOGIC_VECTOR(3 downto 0)。 y1 : OUT STD_LOGIC_VECTOR(6 downto 0)。 y0 : OUT STD_LOGIC_VECTOR(6 downto 0) )。END xianshi。ARCHITECTURE xianshi_architecture OF xianshi ISBEGIN process(a) begin case a is when 0000 = y1=1111110。y0=1111110。 when 0001 = y1=1111110。y0=0110000。 when 0010 = y1=1111110。y0=1101101。 when 0011 = y1=1111110。y0=1111001。 when 0100 = y1=1111110。y0=0110011。 when 0101 = y1=1111110。y0=1011011。 when 0110 = y1=1111110。y0=1011111。 when 0111 = y1=1111110。y0=1110000。 when 1000 = y1=1111110。y0=1111111。 when 1001 = y1=1111110。y0=1111011。 when 1010 = y1=0110000。y0=1111110。 when OTHERS = y1=0110000。y0=0110000。 end case。 end process。 END xianshi_architecture。(8)xuanzeLIBRARY ieee。USE 。use 。ENTITY xuanze IS PORT ( a : IN STD_LOGIC。 q1: in std_logic。 q2: in std_logic。 q : out STD_LOGIC )。 END xuanze。ARCHITECTURE xuanze_architecture OF xuanze ISBEGIN process(a) begin if(a=39。139。) then q=q2。 else q=q1。 end if。 end process。END xuanze_architecture。(9)yimaLIBRARY ieee。USE 。use 。ENTITY xuanze IS PORT ( a : IN STD_LOGIC。 q1: in std_logic。 q2: in std_logic。 q : out STD_LOGIC )。END xuanze。ARCHITECTURE xuanze_architecture OF xuanze ISBEGIN process(a) begin if(a=39。139。) then q=q2。 else q=q1。 end if。 end process。END xuanze_architecture。(10)yanshilibrary ieee。use 。use 。entity yanshi is port ( clk: in std_logic。 y: buffer std_logic_vector(24 downto 0) )。end yanshi。 architecture behave of yanshi is begin process(clk) begin if(clk39。event and clk=39。139。) then if(y=1000000000000000000000000 or y=1111111111111111111111111) then y=0000000000000000000000000。 else y=y+1。 end if。 end if。 end process。end behave。 24