综合课程设计答辩——乒乓球游戏设计
综合课程设计答辩
1实现的功能:模拟路口交通灯的红黄绿的变化过程,用三个led灯显示,并在数码管上动态显示,红的30s,黄的5s,绿的30s.
2核心模块:
a.分频模块:将40M的系统时钟分频以得到1hz的时钟;
b.计数模块:一个是30s的计数,另一个是5s的计数模块;
c.动态扫描模块:以10000为一个分界点(用的是系统时钟),用两个数码管动态显示.
实验一:交通灯的控制
pulse: process(sysclk) --pulse 1s
variable count:integer range 0 to
begin
if clkevent and clk=1 then
count:=count+1;
if countthen clock=1;
elsif countthen clock=0;count:=0;
end if;
end if;
end process pulse;
分频的process:
实验二:电子秒表
1实现功能:完成一个数字时钟的设计,数字时钟具有时,分,秒的功能,使用8个数码管,具有复位功能。
2核心模块:
a.分频模块,与交通灯中类似,获得1hz的时钟。
b.计数模块,有10s,6s和4s的计数模块。
c.动态扫描模块,仍然以10000为一次扫描,动态的显示8个数码管。
10s的计数模块:
architecture art of cnt10 is
signal cqi:std_logic_vector(3 downto 0);
begin
change:process(clk,clr)
begin
if clr=1 then cqi=0000;
elsif clkevent and clk=1 then
if cqi=1001 then cqi=0000;
else cqi=cqi+1;
end if;
end if;
end process change;
outshow:process(cqi)
begin
if cqi=0000 then co=1;
else co=0;
end if;
end process outshow;
cq=cqi;
end architecture art;
scan:process(clk)
variable count :integer range 0 to 80000;
begin
if clkevent and clk=1 then
count:=count+1;
if count=10000 then en outshow=num1;
elsif count=20000 then en outshow=num2;
elsif count=30000 then en outshow=num3;
elsif count=40000 then en outshow=num4;
elsif count=50000 then en outshow=num5;
elsif count=60000 then en outshow=num6;
elsif count=70000 then en outshow=num7;
elsif count=80000 then en outshow=num8;
count:= 0;
end if;
end if;
end process scan;
动态扫描模块:
1实现的功能:模拟打乒乓球的一个过程,比如发球,正确接球,错误接球对方得分,以及接不到球对方得分。用6个led灯的依次闪烁来表现球的方向,用两个开关按键作为乒乓球拍,分别用两个数码管来显示双方的得分。如果一方接球失败,蜂鸣器会响一声,并且对方得一分。
实验三:乒乓球游戏
您可能关注的文档
最近下载
- 《知识图谱技术及应用》课程教学大纲.docx VIP
- 第01讲 二次根式的概念(2个知识点+3类热点题型讲练+习题巩固)(解析版).pdf VIP
- 高级英语精品课程教案 TheFutureoftheEnglish.pdf VIP
- 34-知识图谱-0415000101-教学大纲.pdf VIP
- 2026-2031不干胶标签市场调查报告.docx VIP
- 胃轻瘫多学科联合诊疗专家共识(2025版).pptx VIP
- 知识图谱教学大纲.docx VIP
- 人教版(新版)三年级下册数学全册教案(完整版)教学设计含教学反思.docx
- 苏教版2026-2027学年七年级下册生物教学工作计划(及进度表).docx
- 装潢材料公司采购员述职报告.docx VIP
原创力文档

文档评论(0)