EDA试验设计报告.docx

上传人:b****3 文档编号:5396943 上传时间:2023-05-08 格式:DOCX 页数:15 大小:150.62KB
下载 相关 举报
EDA试验设计报告.docx_第1页
第1页 / 共15页
EDA试验设计报告.docx_第2页
第2页 / 共15页
EDA试验设计报告.docx_第3页
第3页 / 共15页
EDA试验设计报告.docx_第4页
第4页 / 共15页
EDA试验设计报告.docx_第5页
第5页 / 共15页
EDA试验设计报告.docx_第6页
第6页 / 共15页
EDA试验设计报告.docx_第7页
第7页 / 共15页
EDA试验设计报告.docx_第8页
第8页 / 共15页
EDA试验设计报告.docx_第9页
第9页 / 共15页
EDA试验设计报告.docx_第10页
第10页 / 共15页
EDA试验设计报告.docx_第11页
第11页 / 共15页
EDA试验设计报告.docx_第12页
第12页 / 共15页
EDA试验设计报告.docx_第13页
第13页 / 共15页
EDA试验设计报告.docx_第14页
第14页 / 共15页
EDA试验设计报告.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

EDA试验设计报告.docx

《EDA试验设计报告.docx》由会员分享,可在线阅读,更多相关《EDA试验设计报告.docx(15页珍藏版)》请在冰点文库上搜索。

EDA试验设计报告.docx

EDA试验设计报告

EDA试验设计报告

----------之交通灯

学院:

电子工程学院

班级:

021052

学号:

02105123

姓名:

阿鹏仁

一、选题目的:

交通灯作为现代十字路口对交通信号灯进行管理,在我们的出行方面起很大的作用,防止了很多交通事故的发生,是现代交通建设方面不可缺少的一部分。

本次试验是基于EDA技术实现对交通灯设计,因为交通灯比较好实现,各自之间的模块分明,还能掌握在设计交通灯过程中的一些模块,使我更加深刻的理解EDA这门将软件和硬件结合起来的技术。

让我对VHDL语言有了更深一步的了解,跟C语言和其他的语言比起来,VHDL语言呈现了它独特的性质,它是并行运行的一种语言。

此外,通过本次试验,使我熟悉掌握了用EDA技术实现某一工程的全过程,在以后的运用中,能更熟练的操作。

二、设计目标:

一个十字路口交通控制系统,其东西,南北两个方向除了有红、黄、绿灯指示是否允

通行外,还设有时钟,以倒计时方式显示每一路允许通行的时间,绿灯,黄灯,红灯的持续时间分别是40、5和45秒。

当东西或南北两路中任一道上出现特殊情况,例如有消防车,警车要去执行任务,此时交通控制系统应可由交警手动控制立即进入特殊运行状态,即两条道上的所有车辆皆停止通行,红灯全亮,时钟停止计时,且其数字在闪烁。

当特殊运行状态结束后,管理系统恢复原来的状态,继续正常运行。

通过VHDL语言的编写,生成元器件,然后手动连接电路,再对整个过程进行调式,如果正确的话进行波形仿真,波形符合理论上的波形的话,最后一步在把整个程序烧进板子里面,实现对交通灯的模拟。

三、实现方案:

原理框图:

hold=0

 

 

hold=1hold=1hold=1

 

设计流程图:

四、设计过程

设计交通灯需要四个模块,分别是:

分频器、倒计时计数器、控制器、7字段译码器,其对应的实体名为:

devide、M45、control、seg7。

将程序编写好以后,以实体名为名的文件进行保存

各模块代码:

devide模块:

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitydevideis

port(

clk:

instd_logic;

clk_out:

outstd_logic

);

enddevide;

architecturearc_devideofdevideis

signalcount:

std_logic_vector(21downto0);

begin

process

begin

waituntilclk'eventandclk='1';

if(count<4)then

count<=count+1;

clk_out<='0';

else

count<=(others=>'0');

clk_out<='1';

endif;

endprocess;

endarchitecturearc_devide;

 

M45模块:

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitym45is

port(

CLK:

instd_logic;

EN:

instd_logic;

CR:

instd_logic;

QL,QH:

outstd_logic_vector(3downto0);

OC:

outstd_logic

);

endm45;

architecturebehavofm45is

signalcouL,couH:

std_logic_vector(3downto0);

begin

process(CR,CLK,EN)

begin

ifCR='0'then

couL<="0000";

couH<="0000";

elsifclk'eventandclk='1'then

ifEN='1'then

if(couL=0andcouH=0)then

couL<="0100";

couH<="0100";

elsifcouL=0then

couL<="1001";

couH<=couH-1;

else

couL<=couL-1;

endif;

endif;

endif;

endprocess;

process(couL,couH)

begin

if(couL=0andcouH=0)then

OC<='1';

else

OC<='0';

endif;

endprocess;

QL<=couL;

QH<=couH;

endbehav;

control模块:

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitycontrolis

port(clk,hold:

instd_logic;

ared,agreen,ayellow,bred,bgreen,byellow:

outstd_logic);

endcontrol;

architecturebehaviorofcontrolis

typestate_typeis(s0,s1,s2,s3,s4);

signalcurrent_state,next_state:

state_type;

signalcounter:

std_logic_vector(6downto0);

begin

synch:

process

begin

waituntilclk'eventandclk='1';

ifhold='0'then

counter<=counter;

else

ifcounter<=89then

counter<=counter+1;

else

counter<=(others=>'0');

endif;

endif;

endprocess;

process

begin

waituntilclk'eventandclk='1';

current_state<=next_state;

endprocess;

state_trans:

process(current_state)

begin

casecurrent_stateis

whens0=>

ifhold='0'then

next_state<=s4;

else

ifcounter<39then

next_state<=s0;

else

next_state<=s1;

endif;

endif;

whens1=>

ifhold='0'then

next_state<=s4;

else

ifcounter<44then

next_state<=s1;

else

next_state<=s2;

endif;

endif;

whens2=>

ifhold='0'then

next_state<=s4;

else

ifcounter<84then

next_state<=s2;

else

next_state<=s3;

endif;

endif;

whens3=>

ifhold='0'then

next_state<=s4;

else

ifcounter<89then

next_state<=s3;

else

next_state<=s0;

endif;

endif;

whens4=>

ifhold='0'then

next_state<=s4;

else

ifcounter<39then

next_state<=s0;

elsifcounter<44then

next_state<=s1;

elsifcounter<84then

next_state<=s2;

elsifcounter<89then

next_state<=s3;

endif;

endif;

endcase;

endprocess;

output:

process(current_state)

begin

casecurrent_stateis

whens0=>

ared<='0';

agreen<='1';

ayellow<='0';

bred<='1';

bgreen<='0';

byellow<='0';

whens1=>

ared<='0';

agreen<='0';

ayellow<='1';

bred<='1';

bgreen<='0';

byellow<='0';

whens2=>

ared<='1';

agreen<='0';

ayellow<='0';

bred<='0';

bgreen<='1';

byellow<='0';

whens3=>

ared<='1';

agreen<='0';

ayellow<='0';

bred<='0';

bgreen<='0';

byellow<='1';

whens4=>

ared<='1';

agreen<='0';

ayellow<='0';

bred<='1';

bgreen<='0';

byellow<='0';

endcase;

endprocess;

endbehavior;

seg模块:

libraryieee;

useieee.std_logic_1164.all;

entityseg7is

port(dat:

instd_logic_vector(3downto0);

a,b,c,d,e,f,g:

outstd_logic);

endseg7;

architecturearcofseg7is

signaltmp:

std_logic_vector(6downto0);

begin

process(dat)

begin

casedatis

when"0000"=>tmp<="0111111";

when"0001"=>tmp<="0000110";

when"0010"=>tmp<="1011011";

when"0011"=>tmp<="1001111";

when"0100"=>tmp<="1100110";

when"0101"=>tmp<="1101101";

when"0110"=>tmp<="1111101";

when"0111"=>tmp<="0000111";

when"1000"=>tmp<="1111111";

when"1001"=>tmp<="1101111";

when"1010"=>tmp<="1110111";

when"1011"=>tmp<="1111100";

when"1100"=>tmp<="0111001";

when"1101"=>tmp<="1011110";

when"1110"=>tmp<="1111001";

when"1111"=>tmp<="1110001";

whenothers=>null;

endcase;

endprocess;

a<=tmp(6);

b<=tmp(5);

c<=tmp(4);

d<=tmp(3);

e<=tmp

(2);

f<=tmp

(1);

g<=tmp(0);

endarc;

顶层文件:

五、遇到的问题和解决的方案

在此次试验中遇到的问题是,实际按照书上的写好程序后,波形也仿真真确,但是烧到板子的时候没有结果。

最后发现问题出在管脚没有绑定,绑定管脚之后还是没有结果,经分析,发现分频分的太小了,而且理论上的七字段译码器与实际还不一样,最后按照PPT上的改过来之后,结果仿真出来了,但交通灯只有南北方向而没有东西方向,对顶层文件扩充之后,烧到板子结果完全真确。

六、实验结果

波形仿真图:

七、对该课程的意见

对该课程的一点小小的意见是:

希望老师上课多给我们讲一些东西,不要老是叫一些同学上去做题,这样不仅浪费时间而且对我们帮助不大。

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2