2人抢答器

• 设计一个2人抢答器。要求如下:

• 设计任务

• 1. 两人抢答,先抢为有效,用发光二极

• 管显示是否抢到优先答题权。

• 2. 每人2位计分显示,答错了不加分, 答

• 错了不加分,答对了可加10分、20 、

• 30分。

• 3. 每题结束后,裁判按复位,可重新抢

• 答下一题。

• 4. 累计加分可由裁判随时清除。

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_signed.all;

entity qd is

port(i1,i2 : in bit; --抢答器两输入端。

reset : in bit; --抢答器复位端。

g10,g20,g30:in bit; --加分输入端10分、20分、

30分。

light1,light2:out bit:='0'; --抢答标志灯。

t11:out std_logic_vector(6 downto 0):= "0111111"; --"t11、t12", 显示第一个人得分。

t12:out std_logic_vector(6 downto 0):= "0111111";

t21:out std_logic_vector(6 downto 0):= "0111111"; --"t21、t22" ,显示第二个人得分。

signal cs2:integer range 0 to 9;

t22:out std_logic_vector(6 downto 0):= "0111111";

clk:in bit; --时钟输入端

cong:in bit --清零控制端

);

end qd;

architecture stru of qd is

signal cs1:integer range 0 to 9;

signal cs2:integer range 0 to 9;

signal a,b:bit:='0';

signal l1,l2:bit:='0';

begin

process(clk)

begin

if clk'event and clk='1' then

if(cong='1') then

if(reset='1') then

if (i1 ='0' and a='0') then l1

elsif ( i2 ='0' and a='0') then l2

end if;

if (g10 ='0' and l1='1' and b='0' ) then cs1

elsif (g20 ='0' and l1='1' and b='0' ) then cs1

elsif (g30 ='0' and l1='1' and b='0' ) then cs1

end if; --完成第一人的加分。

if(g10='0' and l2='1' and b='0') then cs2

elsif(g20='0' and l2='1' and b='0') then cs2

elsif(g30='0' and l2='1' and b='0') then

cs2

end if; --完成第二人的加分。

if (cs1=0) then t11

elsif (cs1=1) then t11

elsif (cs1=2) then t11

elsif (cs1=3) then t11

elsif (cs1=4) then t11

elsif (cs1=5) then t11

elsif (cs1=6) then t11

elsif (cs1=7) then t11

elsif (cs1=8) then t11

elsif (cs1=9) then t11

end if;

if (cs2=0) then t21

elsif (cs2=1) then t21

elsif (cs2=2) then t21

elsif (cs2=3) then t21

elsif (cs2=4) then t21

elsif (cs2=5) then t21

elsif (cs2=6) then t21

elsif (cs2=7) then t21

elsif (cs2=8) then t21

elsif (cs2=9) then t21

end if;

else l1

end if;

else l1

end if;

else cs1

l1

end if;

light1

light2

t12

t22

end if;

end process;

end stru;

程序说明

1 .

此程序主要由3部分组成,即抢答、加分、显示。 2 .

当一个人抢到优先答题权,发光二极管亮,另一 个人再按按键无效。答题结束后,裁判按复位键, 方可再次抢答。

3.

没人有2个数码管显示累加计分情况,分数分为 3档,用按键来区分。

• 设计一个2人抢答器。要求如下:

• 设计任务

• 1. 两人抢答,先抢为有效,用发光二极

• 管显示是否抢到优先答题权。

• 2. 每人2位计分显示,答错了不加分, 答

• 错了不加分,答对了可加10分、20 、

• 30分。

• 3. 每题结束后,裁判按复位,可重新抢

• 答下一题。

• 4. 累计加分可由裁判随时清除。

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_signed.all;

entity qd is

port(i1,i2 : in bit; --抢答器两输入端。

reset : in bit; --抢答器复位端。

g10,g20,g30:in bit; --加分输入端10分、20分、

30分。

light1,light2:out bit:='0'; --抢答标志灯。

t11:out std_logic_vector(6 downto 0):= "0111111"; --"t11、t12", 显示第一个人得分。

t12:out std_logic_vector(6 downto 0):= "0111111";

t21:out std_logic_vector(6 downto 0):= "0111111"; --"t21、t22" ,显示第二个人得分。

signal cs2:integer range 0 to 9;

t22:out std_logic_vector(6 downto 0):= "0111111";

clk:in bit; --时钟输入端

cong:in bit --清零控制端

);

end qd;

architecture stru of qd is

signal cs1:integer range 0 to 9;

signal cs2:integer range 0 to 9;

signal a,b:bit:='0';

signal l1,l2:bit:='0';

begin

process(clk)

begin

if clk'event and clk='1' then

if(cong='1') then

if(reset='1') then

if (i1 ='0' and a='0') then l1

elsif ( i2 ='0' and a='0') then l2

end if;

if (g10 ='0' and l1='1' and b='0' ) then cs1

elsif (g20 ='0' and l1='1' and b='0' ) then cs1

elsif (g30 ='0' and l1='1' and b='0' ) then cs1

end if; --完成第一人的加分。

if(g10='0' and l2='1' and b='0') then cs2

elsif(g20='0' and l2='1' and b='0') then cs2

elsif(g30='0' and l2='1' and b='0') then

cs2

end if; --完成第二人的加分。

if (cs1=0) then t11

elsif (cs1=1) then t11

elsif (cs1=2) then t11

elsif (cs1=3) then t11

elsif (cs1=4) then t11

elsif (cs1=5) then t11

elsif (cs1=6) then t11

elsif (cs1=7) then t11

elsif (cs1=8) then t11

elsif (cs1=9) then t11

end if;

if (cs2=0) then t21

elsif (cs2=1) then t21

elsif (cs2=2) then t21

elsif (cs2=3) then t21

elsif (cs2=4) then t21

elsif (cs2=5) then t21

elsif (cs2=6) then t21

elsif (cs2=7) then t21

elsif (cs2=8) then t21

elsif (cs2=9) then t21

end if;

else l1

end if;

else l1

end if;

else cs1

l1

end if;

light1

light2

t12

t22

end if;

end process;

end stru;

程序说明

1 .

此程序主要由3部分组成,即抢答、加分、显示。 2 .

当一个人抢到优先答题权,发光二极管亮,另一 个人再按按键无效。答题结束后,裁判按复位键, 方可再次抢答。

3.

没人有2个数码管显示累加计分情况,分数分为 3档,用按键来区分。


相关文章

  • 智力竞赛抢答器
  • 数字电子技术课程设计 智力竞赛抢答器 系 . 部: 指导教师: 专 业: 电子信息工程 班 级: 完成时间: 2011-6-7 设计学生: 陆涛 摘 要 抢答器很广泛的用于电视台.商业机构及学校,为竞赛增添了刺激性.娱乐性,在一定 程上丰富 ...查看


  • 四人智力竞赛抢答器的设计
  • 年论文﹙设计题 目 学生姓名 学号 所在院(系) 专业班级 指导教师 2012年06月10日 学﹚ 四人智力竞赛抢答器的设计 [摘要]应用Multisim 10软件对4路竞赛抢答器进行设计与仿真.四人智力竞赛抢答器电路主要由抢答电路.倒计时 ...查看


  • 智力竞赛抢答装置的设计与调试
  • 项目任务书 题目: 智力竞赛抢答装置的设计与调试 系 部 学科门类 专 业 学 号 姓 名 班 级 2015年12月12日 智力竞赛抢答装置的设计与调试 摘 要 抢答器在现实生活中很常见,主要运用于各类竞赛中.在竞赛中往往分为几组参加,这是 ...查看


  • 十五路智能抢答器
  • 姓 名: 曹卫 课 程 设 计 题 目 学 院 专 业 班 级 姓 名 指导教师 十五路智能抢答器 信息工程学院 通信工程 通行0805 曹卫 周建新 2010年 7 月 9 日 课程设计任务书 学生姓名: 曹卫 专业班级: 通行0805 ...查看


  • 四路智力竞赛抢答器设计
  • 四路多路智能抢答器设计 前言 关于这次设计的用于多人竞赛抢答的器件,在现实生活中很常见,尤其是在随着各种智益电视节目的不断发展,越来越多的竞赛抢答器被用在了其中,这种抢答器的好处是不仅能够锻炼参赛选手的反应能力,而且能增加节目现场的紧张.活 ...查看


  • 八人智力竞赛抢答器
  • 摘 要 本报告设计的八路智力竞赛抢答器电路主要采由74系列常用集成电路组成,涉及到触发器.编码器.加法器.译码器和RC 电路组成的多谐振荡电路.该抢答器具有基本的抢答功能,通过共阴极数码管显示选手的号码.当一轮抢答开始后,首先抢答的人由触发 ...查看


  • _八路智力抢答器
  • 题目 八路智力抢答器的设计 班级 机电09-2班 学号__ ______ 姓名______________ 指导__ _____ 时间 2010年12月 电工电子技术课程设计任务书 目录 1. 总体方案与原理说明. . . . . . . ...查看


  • 智力竞赛抢答器逻辑电路设计1
  • 多路智力竞赛抢答器 XXXX (XXXX 学院 电子信息工程学院,XXXX XXXX) 摘要:抢答器作为一种工具,已经广泛应用于各种智力和知识竞赛场合.本设计以多路智力竞赛抢答器为基本概念,从实际应用出发, 利用电子设计自动化( EDA) ...查看


  • 八路抢答器EDA课程设计VHDL
  • 第一章 EDA技术简介 EDA在通信行业(电信)里的另一个解释是企业数据架构,EDA给出了一个企业级的数据架构的总体视图,并按照电信企业的特征,进行了框架和层级的划分. 20世纪90年代,国际上电子和计算机技术较先进的国家,一直在积极探索新 ...查看


  • 智能抢答器毕业设计
  • 电 子 机 械 高 等 专 科 学 校 2011 届毕业设计(论文) 智能抢答器毕业设计 学生姓名: 指导教师: 专 业: 班 级: - 1 - 目 录 摘要 ········································ ...查看


热门内容