eda技术课程设计-数字式竞赛抢答器内容摘要:

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 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。 end one。 计时模块图 在这个模块中主要实现抢答过程中的计时功能,在有抢答开始后进行 30 秒的倒计时,并且在 30 秒倒计时后无人抢答显示超时并报警。 其中有抢答时钟信号clk2;系统复位信号 rst;抢答使能信号 s;抢答状态显示信号 states;无人抢答警报信号 warn;计时中止信号 stop;计时十位和个位信号 tb, ta。 (三)数据选择模块 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) )。 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。 数据选择模块图 在这个模块中主要实现抢答过程中的数据输入功能,输入信号 a[3..0]、b[3..0]、 c[3..0];计数 输出信号 s;数据输出信号 y;计数脉冲 clk2,实现 a、b、 c 按脉冲轮流选通,在数码管上显示。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。