hdl—课程设计—交通灯控制电路设计.doc

上传人:工**** 文档编号:551146662 上传时间:2024-02-02 格式:DOC 页数:18 大小:2.40MB
返回 下载 相关 举报
hdl—课程设计—交通灯控制电路设计.doc_第1页
第1页 / 共18页
hdl—课程设计—交通灯控制电路设计.doc_第2页
第2页 / 共18页
hdl—课程设计—交通灯控制电路设计.doc_第3页
第3页 / 共18页
hdl—课程设计—交通灯控制电路设计.doc_第4页
第4页 / 共18页
hdl—课程设计—交通灯控制电路设计.doc_第5页
第5页 / 共18页
点击查看更多>>
资源描述

《hdl—课程设计—交通灯控制电路设计.doc》由会员分享,可在线阅读,更多相关《hdl—课程设计—交通灯控制电路设计.doc(18页珍藏版)》请在金锄头文库上搜索。

1、HDL项目设计 课程设计报告 题 目 交通灯控制电路设计 专业、学号 授课班号 学生姓名 指导教师 完成时间 2012/9/3 摘 要本次课程设计通过 HDL 技术设计交通灯控制系统,其设计描述可被不同的工具所支持,可用不同器件来实现。同学们在理论学习的基础上,通过完成一个涉及时序逻辑、组合逻辑、声光输出的,具有实用性、趣味性的小系统设计,使学生不但能够将课堂上学到的理论知识与实际应用结合起来,而且能够对分析、解决实际的数字电路问题进一步加深认识,为今后能够独立进行某些数字应用系统的开发设计工作打下一定的基础。利用 Verilog HDL 语言自顶向下的设计方法设计交通灯控制系统 ,使其实现道

2、路交通的快速正常运转,突出了其作为硬件描述语言的良好的可读性、可移植性和易理解等优点,并通过 Quartus II 和ModelSim 完成综合、仿真。此程序下载到FPGA 芯片后,可应用于实际的交通灯控制系统中。 通常的设计方法基于中、小规模集成电路进行 , 电路元件多、接线复杂、故障率高。随着大规模集成电路的发展、 EDA 技术的出现 , 数字电路的设计进入了一个崭新阶段 。 首先是利用 ModelSim 编写程序,再将程序输入 Quartus II进行进一步的仿真,问题最大之处就是编写的是否正确,是否能出现分析中的仿真。本论文介绍了用 Verilog HDL 语言设计交通灯控制器的方法

3、, 并在 Quartus II系统对 FPGA 芯片进行编译下载 , 由于生成的是集成化的数字电路 ,没有传统设计中的接线问题 , 所以故障率低 、 可靠性高 , 而且体积非常小 。 根据提示更改程序,查找资料及其询问得到更改。使得仿真图与分析图一致,达到理想状态,进行实验箱连接。【关键词】 Verilog HDL 硬件描述语言 交通灯控制器ABSTRACTThis course is designed by HDL design of traffic light control system, its design description can be supported by differ

4、ent tools, implemented by different devices. Students based on theory study, by completing one involving sequential logic, combinational logic, an output, practical, fun little system design, so that the students can not only to the classroom theoretical knowledge and practical application of combin

5、ed, but also to the analysis, solve practical digital circuit problem further understanding, for the future can be independent of certain digital application system design work and lay a foundation.Using Verilog language HDL top-down design method to design the traffic light control system, make its

6、 make traffic fast running, prominent as a hardware description language good readability, portability and easy to understand and other advantages, and through Quartus II and ModelSim completed a comprehensive, simulation. This program is downloaded to FPGA chip, can be applied to the practical traf

7、fic lights control system. The usual design method based on the medium, small scale integrated circuit, circuit element, complex wiring, high failure rate. With the development of large-scale integrated circuits, the appearance of EDA technology, digital circuit design has entered a new stage. The f

8、irst is the use of ModelSim programming, the program input Quartus II for further simulation, the biggest question is written is correct, whether can appear in the analysis of simulation.This paper introduces the use of Verilog language HDL design of traffic lights controller method, and in the Quar

9、tus II system on FPGA chip compiler download, due to the generation of integrated digital circuit, without the traditional design of the wiring problems, so low failure rate, high reliability, and the volume is very small. According to suggest to change the program, to find information and asked to

10、get change. The simulation and analysis of consensus, reached the ideal state, experiment box connection.【 Key words 】 Verilog Hardware Description Language hardware description language traffic light controller 系统设计一、交通灯控制电路设计目标要求:(1)设计一个十字路口的交通灯控制电路,每条路配有红、黄、绿交通信号灯,通过电路对十字路口的两组交通灯的状态实现自动循环控制;(2)实现

11、东西车道和南北车道上的车辆交替运行,每次通行时间为20秒;(3)要求黄灯亮3秒后,红灯才能转为绿灯,黄灯亮时要每秒闪亮一次;(4)东西车道和南北车道每次通行的时间不同且可调;(选作)二、方案的对比分析与确定: 方案一:要将南北方向的红灯的计时设为17,黄灯为3,两者之和为东西方向的绿灯亮的时间相同; 红 17s 黄3s东西方向: 绿20s南北方向: 方案二:红绿时间相同,均为20秒,在红灯的最后3秒加入黄灯闪烁。相比之下,后者的程序较简单,不用过多注意时间的变化。倒数20秒的最后3秒总有一方的黄灯要闪烁,并且两方交替进行。 红17s 红黄3s东西方向: 绿20s南北方向:分析:红灯在黄灯闪烁3

12、秒后才转变成绿灯,起先的思路是红灯亮17秒之后有黄灯闪烁3秒后转成绿灯,为了是程序较简单,在设计时改成了红灯亮了20秒,且最后3秒黄灯也闪烁,之后黄灯不亮,红灯转绿灯。即采用这思路实现设计要求。三、电路方框图及说明:交通灯控制器的系统框图如图1.1所示 数码显 示管 数码显 示管 东西方向 EW 南北方向NS G Y R G Y R 系统控制电路 20s分频器 图1.1交通灯控制器系统框图工作原理如下: 图中设南北方向的红、黄、绿灯分别为NSR、NSY、NSG东西方向的红、黄、绿灯分别为EWK、EWY、EWG。东西为红至17秒时,南北为绿17秒;东西为黄3秒时,南北仍为绿;东西为绿20秒时,南

13、北为先红17秒时黄灯闪3秒,红灯也还继续发亮。南北、东西方向红、黄、绿时间分别为20秒、3秒、20秒,一次循环40秒。四、 电路设计:将设计要求按找条件,分成多个模块,分别对齐进行程序编写。1、倒计时模块:always(posedge clk1 or negedge reset) /clk1用于倒计时begin if(!reset) count=0; else begin N=N+1; if(count=0) begin count=20;ge=count%10;shi=count/10; if(flash=0) begin red1=1;green1=0;red2=0;green2=1;flash=1; end else begin red1=0;green1=1;red2=1;green2=0;flash=0; end end else if(N=0) begin count=count-1; ge=count%10;shi=count/10; end/黄灯闪烁程序 if(count0) yellow1=ye

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业/管理/HR > 商业合同/协议

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号