【正文】
。 END PROCESS。 END IF。 ELSE WARN =39。AND N=19)THEN WARN =NOT WARN。 ELSIF(I=39。 THEN WARN =39。 THEN IF I=39。EVENT AND CLK=39。 BEGIN Q= WARN。 ARCHITECTURE BEHAVE OF ALARM IS SIGNAL WARN:STD_LOGIC。 Q:OUT STD_LOGIC)。 USE 。 仿真圖 10 (四)報警模塊 VHDL 源程序 LIBRARY IEEE。 end PROCESS。 when others=null。 when 01=y=b。 end if。 else count=count+1。139。 elsif(clk239。039。 begin s=count。 9 end sjxz。 s: out std_logic_vector(1 downto 0)。 entity sjxz is port (a,b,c: in std_logic_vector(3 downto 0)。 use 。 仿真圖 (三)數 據選擇模塊 VHDL 源程序 library ieee。 end if。 end if。 then if tb=0000 then tb=0011。 then if s=39。event and co=39。 then tb=0010。 or stop=39。 p2:process(co,rst,s,stop,tb) begin 8 if rst=39。 end if。 end if。139。 then if ta=0000 then ta=1001。 if s=39。 then co=39。event and clk=39。 then ta=0000。 or stop=39。 begin p1:process(clk,rst,s,stop,ta) begin if rst=39。 end js。 warn:out std_logic。 use 。 仿真圖 : 7 (二)計時模塊 VHDL 源程序 library ieee。 end process p2。 elsif (st=1000) then states=0100。 elsif (st=0010) then states=0010。 p2:process(states(0),states(1),states(2),states(3)) begin if (st=0000) then states=0000。 end if 。 end if 。 ) then st(3)=39。 or st(2)=39。 or st(1)=39。)and not( st(0)=39。 or st(3)=39。 if (s3=39。139。139。139。139。139。139。 end if 。 ) then st(1)=39。 or st(3)=39。 or st(2)=39。)and not( st(0)=39。 or st(1)=39。 if (s1=39。139。139。139。139。139。139。139。 elsif clk239。039。039。 architecture one of qdjb is signal st:std_logic_vector(3 downto 0)。 tmp:out std_logic)。 s0,s1,s2,s3:in std_logic。 use 。 三、 單元電路設計 (一)搶答鑒別模塊 VHDL 源程序 library ieee。 分頻模塊: 在這個模塊中主要實現搶答過程中實現輸出雙脈沖的功能。 報警模塊: 在這個模塊中主要實現搶答過程中的報警功能,當主持人按下 控制鍵 ,有限時間 5 內 人搶答或是計數到時蜂鳴器開始報警,有效電平輸入信號 i;狀態(tài)輸出信號 q;計數脈沖 clk2。其中有搶答時鐘信號 clk2;系統(tǒng)復位信號 rst;搶答使能信號 s;搶答狀態(tài)顯示信號 states;無人搶答警報信號 w