




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
JIU JIANG UNIVERSITY 数字逻辑系统课程设计题 目 交通控制器的设计与分析 专 业 电子信息工程 班 级 电子工程学院 姓 名 童远亮 年 级 二零一一级 指导教师 盛健 二零一三年十二月目 录1、摘要 22、系统设计要求23、总体设计方案33.1.状态设置 33.2.系统框图3a.系统总框图3b.系统状态转换框图44、单元电路设计41.交通控制器的内部结构原理图.52.交通控制器的仿真图.55、系统设计程序.56、设计总结.117、参考文献11摘 要随着世界范围内城市化和机动化进程的加快,城市交通越来越成为一个全球化的问题。城市交通基础设施供给滞后于高速机动化增长需求,道路堵塞日趋加重,交通事故频繁,环境污染加剧等问题普遍存在。目前,全国大中城市普遍存在着道路拥挤、车辆堵塞、交通秩序混乱的现象,交通事故频发,这给人民的生命财产安全带来了极大的损失。如何解决城市交通问题已成为全社会关注的焦点和大众的迫切呼声。 在现代城市中,人口和汽车日益增长,市区交通也日益拥挤,人们的安全问题也日益重要。因此,红绿交通信号灯成为交管部门管理交通的重要工具之一。交通信号灯常用与交叉路口,用来控制车的流量,提高叉口车辆的通行能力,减少交通事故。有了交通灯人们的安全出行有了很大的保障。交通控制器拟由单片的CPLD/FPGA来实现,经分析设计要求,拟定整个系统由9个单元电路组成。关键词:交通灯 2.系统设计要求系统设计要求:设计一个由两干道的汇合点形成的十字交叉路口的交通灯控制器,具体要求如下:(1) 干道各设有一个绿、黄、红指示灯,两个显示数码管。(2) 一干道处于常允许通行状态,而另一干道禁止通行。 (3)干道每次放行25 s,禁止放行30s,在一干道禁止放行30s显示红灯时,另一干道显示25s的绿灯后,变成5s的黄灯,让后两灯同步黄灯变红灯,红灯变绿灯,并进行减计时显示。 红绿灯交通信号系统外观示意图如图1所示。倒计数计时器绿灯黄灯红灯红 黄 绿灯 灯 灯 3、 总体方案的设计 3. 1一个干道2个数码管进行倒计时,3个灯红绿黄相互转换,十字交叉路口就是4个数码管,6个灯,编写出3个模块进行控制。 3.2系统图 4、单元电路设计4.1 交通控制器内部逻辑结构原理图 交通控制器拟由单片的CPLD/FPGA来实现,经分析设计要求,拟定整个系统由9个单元电路组成,如图所示。4.2 交通控制器的仿真图5、系统设计程序5.1 倒计时模块Count_25.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count_25 is port ( clock:in std_logic; a_shi:out std_logic_vector(3 downto 0); -输入的数据 a_ge:out std_logic_vector(3 downto 0); a_shi2:out std_logic_vector(3 downto 0); -输入的数据 a_ge2:out std_logic_vector(3 downto 0); flag4:out std_logic_vector(2 downto 0);flag5:out std_logic_vector(2 downto 0); end; architecture bhv of count_25 is signal dis_shi: std_logic_vector(3 downto 0):=0010; signal dis_ge: std_logic_vector(3 downto 0):=0100; signal dis_shi2:std_logic_vector(3 downto 0):=0010; signal dis_ge2: std_logic_vector(3 downto 0):=1001; signal flag1: std_logic; signal flag2: std_logic_vector(2 downto 0):=000; signal flag3: std_logic_vector(2 downto 0):=000;- signal flag4: std_logic; signal clock_count:std_logic_vector(27 downto 0);begin-* a_shi=dis_shi; a_ge=dis_ge; a_shi2=dis_shi2; a_ge2=dis_ge2; flag4=flag2; flag5=flag3;-*one:process(clock) begin if(rising_edge(clock) then clock_count49999999) then clock_count=x0000000; flag1=1; else flag1=0; end if;end if end process;-*24-4-30*two:process(flag1) begin if(flag1=1) then if(flag2=000) then-25秒倒计时 if(dis_shi=0000) then if(dis_ge=0000) then dis_shi=0000; dis_ge=0100; flag2=flag2+1;else dis_ge=dis_ge-1; end if; elsif(dis_ge=0000) then dis_ge=1001; dis_shi=dis_shi-1; else dis_ge=dis_ge-1; end if; end if; -5秒倒计时if(flag2=001) then dis_shi=0000; dis_ge=dis_ge-1; if(dis_ge=0000) then dis_ge=1001;dis_shi=0010;flag2=flag2+1; end if; end if; -30秒倒计时 if(flag2=010) then if(dis_shi=0000) then if(dis_ge=0000) then dis_shi=0010; dis_ge=0100; flag2=000;else dis_ge=dis_ge-1; end if; elsif(dis_ge=0000) then dis_ge=1001; dis_shi=dis_shi-1; else dis_ge=dis_ge-1; -if(dis_shi=0000) and (dis_ge=0100) then - flag2=011; -end if; end if;end if; end if;end process;-*30-24-4*three:process(flag1) beginif(flag1=1) then if(flag3=000) then-30秒倒计时 if(dis_shi2=0000) thenif(dis_ge2=0000) then dis_shi2=0010; dis_ge2=0100; flag3=flag3+1;else dis_ge2=dis_ge2-1; end if;elsif(dis_ge2=0000) then dis_ge2=1001; dis_shi2=dis_shi2-1; else dis_ge2=dis_ge2-1; end if; end if; -24秒倒计时 if(flag3=001) then if(dis_shi2=0000) thenif(dis_ge2=0000) then dis_shi2=0000; dis_ge2=0100; flag3=flag3+1;else dis_ge2=dis_ge2-1; end if;elsif(dis_ge2=0000) then dis_ge2=1001; dis_shi2=dis_shi2-1; else dis_ge2=dis_ge2-1; end if;end if; -5秒倒计时if(flag3=010) then dis_shi2=0000; dis_ge2=dis_ge2-1; if(dis_ge2=0000) thendis_ge2=1001;dis_shi2=0010;flag3=000; end if; end if; end if; end process;end architecture;5.2 数码管模块display.vhd-*-试验箱上使用的共阳数码管pnp三极管驱动给低电平选中-*library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity display is port (clock:in std_logic; wei:out std_logic_vector(7 downto 0); du:out std_logic_vector(7 downto 0); a_shi:in std_logic_vector(3 downto 0); -输入的数据 a_ge:in std_logic_vector(3 downto 0); a_shi2:in std_logic_vector(3 downto 0); -输入的数据 a_ge2:in std_logic_vector(3 downto 0)- flag4:in std_logic); end;architecture bhv of display is signal sel:std_logic_vector(1 downto 0); signal count:std_logic_vector(19 downto 0); signal disp_data:std_logic_vector(3 downto 0);begin if rising_edge(clock) then count=count+1; if(count=250000) then count=x00000; sel=sel+1; if(sel=11) then sel du du du du du du du du du du null; end case;end process;-*位选*process(clock) begin case sel is when 00 = wei wei wei wei null;end case; end process;process(clock) begincase sel is when 00 = disp_data disp_data disp_data disp_data null;end case; end process; end;5.3二极管模块led.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity led is port ( clock:in std_logic; ew_green:out std_logic; -输入的数据 ew_yellow:out std_logic; ew_red:out std_logic; -输入的数据 sn_green:out std_logic; sn_yellow:out std_logic; sn_red:out std_logic; flag5:in std_logic_vector(2 downto 0); flag4:in std_logic_vector(2 downto 0); end; architecture bhv of led isbegin process(clock) begin if(rising_edge(clock) then case flag4 is when 000 = ew_green=0; ew_yellow=1; ew_red=1; sn_red=0; sn_green=1; sn_yellow ew_green=1; ew_yellow=0; ew_red=1; sn_red=0; sn_green=1; sn_yellow ew_green=1; ew_yellow=1; ew_red=0; sn_red=1; sn_green=0; sn_yellow ew_green=1; - ew_yellow=1;- ew_red=0;- sn_red=1;- sn_green=1;- sn_yellownull; end case;if(flag5=010) then ew_green=1; ew_yellow=1; ew_red=0; sn_red=1; sn_green=1; sn_yellow=0; end if; end if;end process;end architecture;6、设计总结 通过这次课程设计,加强了我们动手、思考和解决问题的能力。在设计过程中,经常会遇到这样那样的情况,由于课本上的知识太多,平时课间的学习并不能很好的理解和运用知识,通过动手实践让我们更加熟练的掌握。此次设计,学到了很多课内学不到的东西,比如独立思考解决问题,出现差错的随机应变,和与人合作
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 会计技能考试题库及答案
- 眼镜学考试题库及答案
- 海南安检证考试题库及答案
- 瑞声科技培训笔试题目及答案
- 人事专员笔试试题及答案
- 国际碳交易视角下森林碳汇市场价格的多维剖析与策略构建
- 2025免疫培训试题及答案
- 地球公转与四季地理基础知识试题及答案
- 涂料清工合同(标准版)
- 音乐旋律创作音乐基础知识试题及答案
- 2025年上半年金华义乌市经信委招考易考易错模拟试题(共500题)试卷后附参考答案
- 兽医市场营销与管理试题及答案
- 数据中心锂离子电池消防安全白皮书
- 啤酒代理合作协议
- 甲亢护理诊断及措施
- 精雕雕刻机安全操作规程模版(2篇)
- 蓝耳病防控措施
- 护工护理员院感培训
- 物业管理服务内容标准及质量保证措施
- 全国第三届职业技能大赛(建筑金属构造项目)选拔赛理论考试题库(含答案)
- 决战朝鲜课件
评论
0/150
提交评论