【正文】
0 to 1。 signal clk_1k,clk_100h:std_logic。 signal data:std_logic_vector(3 downto 0)。 signal s:std_logic_vector(6 downto 0)。 signal h:std_logic_vector(2 downto 0)。 signal j:std_logic_vector(3 downto 0)。 begin process (clk) variable t1:integer range 0 to variable t2:integer range 0 to 100。 begin if clk39。event and clk=39。139。 then if t1=250 then t1:=0。 if t2=100 then t2:=0。 clk_1k=not clk_1k。 else t2:=t2+1。 end if。 else t1:=t1+1。 end if。 end if。 end process。 process(clk_1k) begin if i=39。139。 then if n=0 then if u=39。039。then led3=0001。 j=0111。 n=n+1。 elsif r=39。039。 then led3=0010。 j=1011。 n=n+1。 elsif t=39。039。 then led3=0011。 j=1101。 n=n+1。 elsif y=39。039。 then led3=0100。 j=1110。 n=n+1。 end if。 end if。 else h=100。 n=0。 led3=0000。 j=1111。 end if。 k=h。 o=j。 end process。 end。 第二部分:數(shù)值輸入模塊 library ieee。 use 。 use 。 use 。 entity WER is port(rst,clk,tsr,en:in std_logic。 p:out