vhdl拔河设计报告_第1页
vhdl拔河设计报告_第2页
vhdl拔河设计报告_第3页
vhdl拔河设计报告_第4页
vhdl拔河设计报告_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

现代电子系统设计期末实验报告现代电子系统设计期末实验报告课题:设计十六:拔河游戏机姓名: 学号: 日期:2012年12月17日 一、 方案设计与论证 本设计主要设计思想、程序流程参照下图所示: 本拔河游戏机主要由加/减计数器、译码器、得分计数及显示模块四大模块组成。输入信号共有in1、in2、begin、reset、reset1五个,其中in1、in2分别为两位选手的按键脉冲输入,begin为裁判控制信号,reset是加/减计数器清零信号,reset1是得分计数器清零信号;两组输出信号分别控制LED灯代表拔河绳结位置及动态数码管显示分数。二、 电路图及有关设计文件1. 加/减计数器模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jishu is port (reset: in std_logic; cpu,cpd:in std_logic; q:out std_logic_vector(3 downto 0) );end jishu;architecture jishu_architecture of jishu is signal countu,countd:std_logic_vector(3 downto 0);beginprocess(cpu,cpd,reset)begin if cpuevent and cpu=1 then countu=countu+1; -甲按键一次,加计数器+1 end if; if cpdevent and cpd=1then countd=countd-1; -乙按键一次,减计数器-1 end if; if reset=0 then countu=0000; countd=0000; end if; q y0=1;y1=0;y2=0;y3=0;y4=0;y5=0;y6 y1=1;y0=0;y2=0;y3=0;y4=0;y5=0;y6 y2=1;y1=0;y0=0;y3=0;y4=0;y5=0;y6 y3=1;y1=0;y2=0;y0=0;y4=0;y5=0;y6 y4=1;y1=0;y2=0;y3=0;y0=0;y5=0;y6 y5=1;y1=0;y2=0;y3=0;y4=0;y0=0;y6 y6=1;y1=0;y2=0;y3=0;y4=0;y5=0;y0=0; end case;end process;end yima_architecture; 3. 得分计数器模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jishu2 isport( a,b,reset1:in std_logic; s1,s2:out std_logic_vector(3 downto 0) ); end jishu2; architecture behave of jishu2 is signal m1,m2:std_logic_vector(3 downto 0); begin process(a,b,reset1) begin if aevent and a=1 then m1=m1+1; end if; if bevent and b=1 then m2=m2+1; end if; if reset1=0 then m1=0000; m2=0000; end if; s1=m1; s2=m2; end process;end behave; 4. 显示模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xianshi isport(clk:in std_logic; a,b:in std_logic_vector(3 downto 0); s:out std_logic_vector(7 downto 0); p:out std_logic_vector(6 downto 0) ); end xianshi; architecture behave of xianshi issignal count:std_logic_vector(15 downto 0);signal clk1:std_logic; begin process(a,b,clk) beginif rising_edge(clk) then count=count+1;end if;clk1 case a is when0000= s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p case b is when0000= s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p s=;p=; end case; end case;end process;end behave;5. 总设计图三、 仿真结果与测试分析由上图仿真结果可知,当begin信号为1时,y6.0即LED灯显示才开始改变,代表裁判按下begin开关后才能开始比赛。in1变化速度比in2快时,y6.0即LED灯逐渐左移到顶端,数码管显示数字加一。以此类推,其余功能不加以赘述。四、 设计总结1 同一进程中对同一变量不能重复赋值;2 同一进程并行语句只能检测一个脉冲的

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论