- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
 - 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
 - 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
 - 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
 - 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
 - 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
 - 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
 
                        查看更多
                        
                    
                现代电子系统设计期末实验报告
现代电子系统设计期末实验报告
课题:设计十六:拔河游戏机
姓名:       
学号:    
日期:2012年12月17日    
方案设计与论证
   本设计主要设计思想、程序流程参照下图所示:
  本拔河游戏机主要由加/减计数器、译码器、得分计数及显示模块四大模块组成。输入信号共有in1、in2、begin、reset、reset1五个,其中in1、in2分别为两位选手的按键脉冲输入,begin为裁判控制信号,reset是加/减计数器清零信号,reset1是得分计数器清零信号;两组输出信号分别控制LED灯代表拔河绳结位置及动态数码管显示分数。
电路图及有关设计文件
加/减计数器模块
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);
begin
process(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=countu+countd+3;                --q初始值设为3, 译码结果为点亮中间的LED灯
end process;
end jishu_architecture;
译码器模块
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity yima is
 port
 ( 
  d:in std_logic_vector(3 downto 0);
  y0:buffer std_logic;
  y1:buffer std_logic;
  y2:buffer std_logic;
  y3:buffer std_logic;
  y4:buffer std_logic;
  y5:buffer std_logic;
  y6:buffer std_logic
  );
end yima;
architecture yima_architecture of yima is
begin
process(d)
 begin
   case d is               --根据加/减计数器结果判断点亮LED灯
    when 0000= y0=1;y1=0;y2=0;y3=0;y4=0;y5=0;y6=0;
    when 0001= y1=1;y0=0;y2=0;y3=0;y4=0;y5=0;y6=0;
    when 0010= y2=1;y1=0;y0=0;y3=0;y4=0;y5=0;y6=0;
    when 0011= y3=1;y1=0;y2=0;y0=0;y4=0;y5=0;y6=0;
    when 0100= y4=1;y1=0;y2=0;y3=0;y0=0;y5=0;y6=0;
    when 0101= y5=1;y1=0;y2=0;y3=0;y4=0;y0=0;y6=0;
    when others= y6=1;y1=0;y2=0;y3=0;y4=0;y5=0;y0=0;
   end case;
end process;
end yima_architecture;                                                                                                                                                     
                
原创力文档
                        

文档评论(0)