【正文】
nge 0 to 139。 else t2:=t2+1。 end if。 then if n=0 then if u=39。 n=n+1。 j=1011。 then led3=0011。039。 end if。 led3=0000。 o=j。 use 。 p:out std_logic。 cout:out std_logic_vector(6 downto 0))。 signal clk_1k:std_logic。 signal dout:std_logic_vector(5 downto 0)。 variable t2:integer range 0 to 100。 then if t1=250 then t1:=0。 end if。 end process。event and clk=39。 clk_100h=not clk_100h。 end if。event and clk_1k=39。 end if。 when 1=dout=111101。 end process。 when others=null。039。 else if rst=39。039。event and clk_100h=39。 then if (led1=0000) then led1=1001。 if w=5 then p=39。039。 end if。 end if。 process(data) begin case data is when0000=s=0111111。3 when0100=s=1100110。7 when1000=s=1111111。 end process。 第三部分:譯碼模塊 library ieee。 entity yima is port( h:in std_logic_vector(6 downto 0)。 f=h(5)。 b=h(1)。當(dāng)主持人按下復(fù)位開關(guān)時,四個按鍵開關(guān)生效。若參賽者在規(guī)定的時間內(nèi)回答完問題,主持人可以 用開關(guān) 給出計時停止信號,以免揚(yáng)聲器鳴叫。搶答完后,顯示管顯示選手的號數(shù)。 end one。 d=h(3)。 end。 use 。 cout=s。9 when