【正文】
00。 END YMQ。 ENTITY YMQ IS PORT(AIN4: IN STD_LOGIC_VECTOR(3 DOWNTO 0)。 USE 。 仿真圖 報(bào)警模塊圖 13 在這個(gè)模塊中主要實(shí)現(xiàn)搶答過(guò)程中的報(bào)警功能,當(dāng)主持人按下控制鍵,有限時(shí)間內(nèi)如果人搶答或是計(jì)數(shù)到時(shí)蜂鳴器開(kāi)始報(bào)警,有效電平輸入信號(hào) i;狀態(tài)輸出信號(hào) q;計(jì)數(shù)脈沖clk2。 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。 12 ARCHITECTURE BEHAVE OF ALARM IS SIGNAL WARN:STD_LOGIC。 Q:OUT STD_LOGIC)。 USE 。 (四)報(bào)警模塊 VHDL 源程序 LIBRARY IEEE。 end body_chooser。 end case。 when 10=y=c。 case count is when 00=y=a。 end if。)then if(count=10)then count=00。event and clk2=39。)then count=00。 process(clk2,rst) begin if(rst=39。 architecture body_chooser of sjxz is signal count: std_logic_vector (1 downto 0)。 10 y: out std_logic_vector(3 downto 0) )。 clk2,rst: in std_logic。 use 。 use 。其中有搶答時(shí)鐘信號(hào) clk2;系統(tǒng)復(fù)位信號(hào) rst;搶答使能信號(hào) s;搶答狀態(tài)顯示信號(hào) states;無(wú)人搶答警報(bào)信號(hào) warn;計(jì)時(shí)中止信號(hào) stop;計(jì)時(shí)十位和個(gè)位信號(hào) tb, ta。 end one。 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 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 8 if rst=39。 end js。 warn:out std_logic。 use 。 (二)計(jì)時(shí)模塊 VHDL 源程序 library ieee。 仿真圖 : 搶答鑒別模塊圖 7 在這個(gè)模塊中主要實(shí)現(xiàn)搶答過(guò)程中的搶答功能,并能對(duì)超前搶答進(jìn)行警告,還能記錄無(wú)論是正常搶答還是朝前搶答者的臺(tái)號(hào),并且能實(shí)現(xiàn)當(dāng)有一路搶答按鍵按下時(shí),該路搶答信號(hào)將其余個(gè)綠搶答封鎖的功能。 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)) 6 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。