傻大方


首页 > 学习 >

VHDL|VHDL数字电路综合实验交通灯( 二 )



按关键词阅读: 综合 实验 交通灯 数字电路 VHDL


当特殊情况结束后 , 控制器恢复原来状态 , 继续正常工作 。
用两组数码管 。

8、 , 以倒计时方式显示两个方向允许通行或禁止通行的剩余时间 。
当绿灯和另一红灯同时亮时 , 允许左拐 。
编译结果ControlA模块状态转移图ControlB模块状态转移图仿真波形波形方针时 , 为方便观察 , 将分频器改为10分频。
通过观察 , r1,y1,g1,t1,r2,y2,g2,t2可看出为循环显示 , 一方向为红灯时 , 另一方向显示绿灯、转弯灯、黄灯 。
放大后可看到倒计时显示的变化 , 以及共阴极控制的选择当按下KEY键 , key信号产生脉冲 , 进入紧急状态 , 只有两盏红灯亮 , 同时蜂鸣器产生蜂鸣信号 , 当再次按下KEY键 , 紧急状态解除放大后 , 可看出计时暂停 , 并且数码管共阴极选择会在全1信号和选择信号间交替 , 产生闪烁效果 。
故 。

9、障及问题分析;u 开始时 , 选用了低频CLK信号 , 无法准确控制时间长短 , 经老师指点换用了高频信号 , 同时修改了分频电路以准确分频 。
u 对程序的选择分支认识不清楚 , case语句嵌套不正确 , 编译后系统宏单元超出 , 修改嵌套关系后 , 宏单元大幅下降 。
总结和结论;通过综合实验的思考和设计 , 对一个项目的整体设计有了进一步认识 。
当看到要求后 , 应该对项目进行分功能和模块的设计 , 自顶向下 , 完成顶层的设计后 , 再编写功能模块 。
模块化设计便于修改和查错 。
通过程序的编写 , 加深了对VHDL语言的了解 , 提高了编程能力 。
同时 , 锻炼了独立发现问题解决问题的能力 , 提高了个人素质 。
所用元器件及测试仪表清单u 稳压电源u 万用表u 示波器 。

10、u 计算机u 实验板一块u Quartus II 完整源程序u Emergency模块library ieee;
use ieee.std_logic_1164.all;
entity Emergency is port(BTN_in:in std_logic;
-接收按键信息BTN_out:out std_logic-输出紧急信号);
end Emergency;
architecture Emergency_arc of Emergency isbeginprocess(BTN_in)variable temp: std_logic;
beginif BTN_inevent and BTN_in=1。

11、thentemp:= not temp;
-当有紧急信号时 , 输出信号切换end if;
BTN_out-非紧急状态voicetemptemptemptemptemp-紧急状态voicetemptemptemptemptemptime_outtime_outtime_outtime_outtime_outnum_outnum_outnum_outnum_outnum_outnum_outnum_outnum_outnum_outnum_outnum_out-非紧急状态case temp_color iswhen yellow=-黄灯tempr:=0;
tempg:=0;
tempy:=1;
tempt:= 。

12、0;
case reset is-计时部分when 0 =-归零temp_h:=0000;
temp_l:=0100;
reset:=1;
when others =-计时case temp_l iswhen 0000=temp_l:=1001;
temp_h:=temp_h-1;
when 0001=case temp_h iswhen 0000 =temp_h:=0000;
temp_l:=0000;
reset:=0;
temp_color:=red;
when others =temp_l:=0000;
end case;
when others=temp_l:=temp_l-1;
end case;
end c 。

13、ase;
when green=-绿灯tempr:=0;
tempg:=1;
tempy:=0;
tempt:=0;
case reset is-计时部分when 0 =-归零temp_h:=0000;
temp_l:=1001;
reset:=1;
when others =-计时case temp_l iswhen 0000=temp_l:=1001;
temp_h:=temp_h-1;
when 0001=case temp_h iswhen 0000 =temp_h:=0000;
temp_l:=0000;
reset:=0;
temp_color:=turn;
when others =temp_l:=0000 。

14、;
end case;
when others=temp_l:=temp_l-1;
end case;
end case;
when red=-红灯tempr:=1;
tempg:=0;
tempy:=0;
tempt:=0;
case reset is-计时部分when 0 =-归零temp_h:=0010;
temp_l:=0100;
reset:=1;
when others =-计时case temp_l iswhen 0000=temp_l:=1001;
temp_h:=temp_h-1;
when 0001=case temp_h iswhen 0000 =temp_h:=0000;
temp_l:=0000;


15、reset:=0;
temp_color:=green;
when others =temp_l:=0000;
end case;
when others=temp_l:=temp_l-1;
end case;
end case;
when turn=-转弯tempr:=0;
tempg:=1;
tempy:=0;
tempt:=1;
case reset is-计时部分when 0 =-归零temp_h:=0000;
temp_l:=1001;
reset:=1;
when others =-计时case temp_l iswhen 0000=temp_l:=1001;
temp_h:=temp_h-1;
when 000 。

16、1=case temp_h iswhen 0000 =temp_h:=0000;
temp_l:=0000;
reset:=0;
temp_color:=yellow;
when others =temp_l:=0000;
end case;
when others=temp_l:=temp_l-1;
end case;
end case;
end case;
when others=-紧急状态tempr:=1;
tempg:=0;
tempy:=0;
tempt:=0;
end case;
end if;
timeh=temp_h;
timel=temp_l;
r=tempr;
g=tempg;
y=tempy;
t=tempt;
end process;
end ;
参考文献 。
23 。


稿源:(未知)

【傻大方】网址:/a/2021/0902/0024074830.html

标题:VHDL|VHDL数字电路综合实验交通灯( 二 )


上一篇:放弃|放弃升学转就业申请书

下一篇:建设项目|建设项目评估