【正文】
。 ELSE CQI=CQI+39。139。 END IF。 END IF。END PROCESS。CQ=CQI。END ART。REG32的源程序library ieee。use 。use 。entity reg32 is port(d:in std_logic_vector(31 downto 0)。 en:in std_logic。 q:out std_logic_vector(31 downto 0)。 clr:in std_logic)。end entity reg32。architecture art of reg32 is begin process(en,d) isbeginif clr=39。139。 then q=00000000000000000000000000000000。elsif(en=39。139。) then Q=d。end if。end process。end architecture art。SELECR8_1源程序library ieee。use 。use 。entity select8_1 is port(d0,d1,d2,d3,d4,d5,d6,d7:in std_logic_vector(31 downto 0)。 ar:in std_logic_vector(3 downto 0)。 y:out std_logic_vector(31 downto 0))。end entity select8_1。architecture art of select8_1 issignal d: std_logic_vector(31 downto 0)。signal a : std_logic_vector(3 downto 0)。begina=ar。 process(d0,d1,d2,d3,d4,d5,d6,d7,a) isbegin case a iswhen 1000=y=d0。when 0001=y=d1。when 0010=y=d2。when 0011=y=d3。when 0100=y=d4。when 0101=y=d5。when 0110=y=d6。when 0111=y=d7。when others=y=00000000000000000000000000000000。end case。end process。end architecture art。HC4511源程序library ieee。use 。use 。entity hc4511 is port( din :in std_logic_vector(3 downto 0)。 dout:out std_logic_vector(6 downto 0))。end entity 。architecture art of hc4511 issignal sd:std_logic_vector(3 downto 0)。begin sd=din。process(sd) isbegincase sd iswhen0000=dout=0111111。when0001=dout=0000110。when0010=dout=1011011。when0011=dout=1001111。when0100=dout=1100110。when0101=dout=1101101。when0110=dout=1111100。when0111=dout=0000111。when1000=dout=1111111。when1001=dout=1101111。when others=dout=0000000。end case。end process。end architecture art。FANGXIANGQI的源程序library ieee。use 。use 。entity fanxiangqi isport(clk,clr:in std_logic。 t: out std_logic)。end entity fanxiangqi 。architecture art of fanxiangqi issignal b :std_logic。 begin process(clk) isbegin if clr=39。139。 then b=39。039。elsif clk39。event and clk=39。139。 then b=not b。 end if。end process。t=b。end architecture art。DECODER38源程序Library ieee。use 。entity DECODER38 is port(a: in std_logic_vector(3 downto 0)。 Y: out std_logic_vector(7 downto 0))。end entity DECODER38。architecture art of DECODER38 is siganl indata: std_logic_vector(3 downto 0)。 begim indata = a。 process(indata) begincase indata is when 0000= Y=00000001。 when 0001= Y=00000010。 when 0010= Y=00000100。 when 0011= Y=00001000。 when 0100= Y=00010000。 when 0101= Y=00100000。 when 0110= Y=01000000。 when 0111= Y=10000000。 when OTHERS = Y=00000000。 end case。 end process。end architecture art。JYMK的源程序library ieee。use 。use 。entity jymk isport(d0,d1,d2,d3,d4,d5,d6,d7:in std_logic_vector(31 downto 0)。 clr,jishu:std_logic。 q0,q1,q2,q3,q4,q5,q6,q7:out std_logic_vector(31 downto 0))。end entity jymk。architecture art of jymk is ponent decoder38 port(a: in std_logic_vector(3 downto 0)。 Y: out std_logic_vector(7 down 0))。end ponent。 ponent reg32 port(d:in std_logic_vector(31 downto 0)。 en:in std_logic。 q:out std_logic_vector(31 downto 0)。 clr:in std_logic)。end ponent。ponent t8 PORT (clk: in std_logic。 clr: in std_logic。 cq: out std_logic_vector(3 downto 0))。end ponent。 signal z:std_logic_vector(3 downto 0)。signal p:std_logic_vector(7 downto 0)。beginu0:reg32 port map(d=d0,q=q0,en=p(0),clr=clr)。u1:reg32 port map(d=d1,q=q1,en=p(1),clr=clr)。u2:reg32 port map(d=d2,q=q2,en=p(2),clr=clr)。u3:reg32 port map(d=d3,q=q3,en=p(3),clr=clr)。u4:reg32 port map(d=d4,q=q4,en=p(4),clr=clr)。u5:reg32 port map(d=d5,q=q5,en=p(5),clr=clr)。u6:reg32 port map(d=d6,q=q6,en=p(6),clr=clr)。u7:reg32 port map(d=d7,q=q7,en=p(7),clr=clr)。u8:decoder38 port map(y=p(7 downto 0),a=z(3 downto 0))。u9:t8 port map(cq=z(3 downto 0),clr=clr,clk=jishu)。end art。JSMK源程序library ieee。use 。use 。entity jsmk isport(clk,stop,clr:std_logic。 y:out std_logic_vector(31 downto 0))。end entity jsmk。architecture art of jsmk isponent t10 port (。clk: in std_logic。 clr: in std_logic。 ena: in std_logic。 cq: out std_logic_vector(3 downto 0)。 carry_out: out std_logic)。end ponent。ponent t6 port (clk: in std_logic。 clr: in std_logic。 ena: in std_logic。 cq: out std_logic_vector(3 downto 0)。 carry_out: out std_logic)。end ponent。ponent fanxiangqiport(clk,clr:in std_logic。 t: out std_logic)。end ponent。signal carry1,carry2,carry3,carry4,carry5,car