基于eda抢答器的设计内容摘要:

elsif clk39。 event and clk=39。 139。 then co=39。 039。 if s=39。 139。 then if ta=0000 then ta=1001。 co=39。 139。 else ta=ta1。 end if。 end if。 end if。 end process p1。 p2:process(co,rst,s,stop,tb) begin 8 if rst=39。 039。 or stop=39。 139。 then tb=0010。 elsif co39。 event and co=39。 139。 then if s=39。 139。 then if tb=0000 then tb=0011。 else tb=tb1。 end if。 end if。 end if。 end process p2。 仿真图 (三)数 据选择模块 VHDL 源程序 library ieee。 use。 use。 use。 entity sjxz is port (a,b,c: in std_logic_vector(3 downto 0)。 clk2,rst: in std_logic。 s: out std_logic_vector(1 downto 0)。 y: out std_logic_vector(3 downto 0) )。 9 end sjxz。 architecture body_chooser of sjxz is signal count: std_logic_vector (1 downto 0)。 begin s=count。 process(clk2,rst) begin if(rst=39。 039。 )then count=00。 elsif(clk239。 event and clk2=39。 139。 )then if(count=10)then count=00。 else count=count+1。 end if。 end if。 case count is when 00=y=a。 when 01=y=b。 when 10=y=c。 when others=null。 end case。 end PROCESS。 end body_chooser。 仿真图 10 (四)报警模块 VHDL 源程序 LIBRARY IEEE。 USE。 USE。 ENTITY ALARM IS PORT(CLK,I:IN STD_LOGIC。 Q:OUT STD_LOGIC)。 END ALARM。 ARCHITECTURE BEHAVE OF ALARM IS SIGNAL WARN:STD_LOGIC。 SIGNAL N:INTEGER RANGE 0 TO 20。 BEGIN Q= WARN。 PROCESS(CLK) BEGIN IF CLK39。 EVENT AND CLK=39。 139。 THEN IF I=39。 039。 THEN WARN =39。 039。 ELSIF(I=39。 139。 AND N=19)THEN WARN =NOT WARN。 N=N+1。 ELSE WARN =39。 039。 END IF。 END IF。 END PROCESS。 END BEHAVE。 11 仿真图 (五)译码模块 VHDL 源程序 LIBRARY IEEE。 USE。 USE。 ENTITY YMQ IS PORT(AIN4: IN STD_LOGIC_VECTOR(3 DOWNTO 0)。 DOUT7: OUT STD_LOGIC_VECTOR(6 DOWNTO 0))。 END YMQ。 ARCHITECTURE ART OF YMQ IS BEGIN PROCESS(AIN4) BEGIN CAS。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。