eda课程实训设计交通信号灯设计实现docWord格式.docx

上传人:b****8 文档编号:22493142 上传时间:2023-02-04 格式:DOCX 页数:19 大小:45.97KB
下载 相关 举报
eda课程实训设计交通信号灯设计实现docWord格式.docx_第1页
第1页 / 共19页
eda课程实训设计交通信号灯设计实现docWord格式.docx_第2页
第2页 / 共19页
eda课程实训设计交通信号灯设计实现docWord格式.docx_第3页
第3页 / 共19页
eda课程实训设计交通信号灯设计实现docWord格式.docx_第4页
第4页 / 共19页
eda课程实训设计交通信号灯设计实现docWord格式.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

eda课程实训设计交通信号灯设计实现docWord格式.docx

《eda课程实训设计交通信号灯设计实现docWord格式.docx》由会员分享,可在线阅读,更多相关《eda课程实训设计交通信号灯设计实现docWord格式.docx(19页珍藏版)》请在冰豆网上搜索。

eda课程实训设计交通信号灯设计实现docWord格式.docx

根据要实现的功能及各状态之间的转换经分析,正常状态下交通信号灯可以分为4个状态分别为表一中的S1、S2、S3、S4,在出现特殊情况或者在深夜时,状态转移分别是S5、S6,各状态之间持续时间详见表一,状态转移图详见图2.。

表1交通信号各灯状态详细表

交通灯

东西方向

南北方向

持续

时间

状态

红(led7)

黄(led6)

绿(led5)

红(led2)

黄(led1)

绿(led0)

S1

1

12

S2

4

S3

S4

S5

/

S6

(3)显示模块设计

串行连接,即每个数码管对应的引脚都连接在一起,通过控制公共端为高电平控制相应数码管的亮,灭(共阴极数码管的公共端为高电平时,LED不亮;

共阳极的公共端为低电平时,LED不亮)

5、实训步骤及仿真结果

1.实训步骤

·

设计输入:

使用原理图、硬件描述语言(VHDL、AHDL、VerilogHDL)等设计文件对待设计的功能做设计图。

综合:

将硬件描述语言翻译成由逻辑门、触发器、寄存器等组成的电路结构。

布局布线:

利用综合后的网表文件,将逻辑和时序要求映射到目标器件中,进行目标器件逻辑资源的分配、布线、互联等。

仿真:

利用软件,验证设计的正确性。

仿真分为功能仿真和时序仿真,功能仿真仅验证逻辑功能,不包含时延信息。

时序分析:

观察和报告时序信息,并可进行时序约束。

主要参数有:

建立时间(tsu)、保持时间(th)、时钟至输出延时(tco)、引脚至引脚延时(tpd)、最大时钟频率(fmax)等.

编程和配置:

设计流程的最后一步,将软件产生的配置文件下载到目标器件中,进行硬件的实现和验证。

2.时序仿真

 

3.硬件仿真

在完成设计输入及成功编译、仿真后经编译无错后,设置pins锁定引脚,(详见管脚分配表2),经过硬件检验,可以实现如下功能:

1)在交通信号灯开始工作前,等待系统指令。

2)按下key0键,系统切换至正常工作,交通信号灯在正常的顺序下开始闪烁,同时数码管可以实时显示剩余等待时间。

3)按下key1键,系统切换至红灯状态,目的为了在交通事故出现后及时进行事故处理。

4)按下key2键,系统切换至深夜工作状态,全部亮黄灯提醒,过往车辆慢速行驶。

表2管脚分配表

原理图

Mode5

EP3C10E144

PIO0

CLK1

PIN38

PIO26

SEG3

PIN74

SW0

PIN86

PIO27

SEG4

PIN75

PIO15

LED0

PIN60

PIO28

SEG5

PIN76

PIO16

LED1

PIN64

PIO29

SEG6

PIN77

PIO17

LED2

PIN65

PIO30

SEG7

PIN79

PIO18

LED3

PIN66

PIO31

DIG0

PIN80

PIO19

LED4

PIN67

PIO32

DIG1

PIN83

PIO20

LED5

PIN68

PIO33

DIG2

PIN84

PIO21

LED6

PIN69

PIO34

DIG3

PIN85

PIO22

LED7

PIN70

PIO35

DIG4

PIN4

PIO23

SEG0

PIN71

PIO36

DIG5

PIN3

PIO24

SEG1

PIN72

PIO37

DIG6

PIN2

PIO25

SEG2

PIN73

PIO38

DIG7

PIN1

6、实训总结

在这次EDA实训中,我们充分运用了上学期学习的知识,将分频器和状态机等知识融入其中,实现了更加智能化的交通灯系统设计,程序代码更易扩展。

通过一个星期的实训,我们对于交通灯的控制原理有了清晰的了解,进一步加深了EDA程序设计的熟练程度。

对QuartusII8.0仿真工具使用更加得心应手。

这次实训,我们分工明确,积极配合,体现了团队协作的精神,圆满完成了实训任务。

附录

(十字路口交通灯程序代码)

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_arith.all;

entityjtdis

port(clock:

instd_logic;

reset,reset1,reset2:

seg_out:

outstd_logic_vector(7downto0);

q_out:

w:

outstd_logic_vector(7downto0)

);

end;

architecturebhvofjtdis

componentqhz_any

port(clk:

Q:

outstd_logic

endcomponent;

componentqhz_any1

componentjsq0123

outstd_logic_vector(1downto0));

endcomponent;

componentmux21a

port(s:

instd_logic_vector(1downto0);

a,b,c,d:

instd_logic_vector(7downto0);

y:

w1:

componenttraffic

port(clk:

rst,rst1,rst2:

times:

outintegerrange0to100;

q:

shi0,shi1:

ge0,ge1:

outstd_logic_vector(7downto0)

signalm1:

std_logic;

signalm2:

signalm3:

integerrange0to100;

signalm4:

std_logic_vector(7downto0);

signalm5:

signalm6:

std_logic_vector(1downto0);

signalm7:

signalm8:

begin

u1:

qhz_anyportmap(clk=>

clock,Q=>

m1);

u2:

qhz_any1portmap(clk=>

m2);

u3:

jsq0123portmap(clk=>

m2,Q=>

m6);

u4:

trafficportmap(clk=>

m1,q=>

q_out,rst=>

reset,rst1=>

reset1,rst2=>

reset2,ge0=>

m4,shi0=>

m5,ge1=>

m7,shi1=>

m8);

u5:

mux21aportmap(a=>

m4,b=>

m5,c=>

m7,d=>

m8,y=>

seg_out,s=>

m6,w1=>

w);

endbhv;

-------------miaofenpin-----------

entityqhz_anyis

generic(n:

integer:

=20000);

outstd_logic);

endqhz_any;

architecturebhvofqhz_anyis

begin

process(clk)

variablecout:

=0;

ifclk'

eventandclk='

1'

then

ifcout<

(n/2)then

Q<

='

;

cout:

=cout+1;

elsifcout<

(n-1)then

0'

elsecout:

endif;

endprocess;

endbhv;

-------------jishuqi0123-----------

entityjsq0123is

endjsq0123;

architecturebhvofjsq0123is

signalcqi:

std_logic_vector(1downto0);

cqi<

=cqi+1;

=cqi;

----------------scanfenpin-----------

entityqhz_any1is

=20);

endqhz_any1;

architecturebhvofqhz_any1is

--------------------traffic-------------

entitytrafficis

rst,rst1,rst2:

shi0,ge0,ge1,shi1:

outstd_logic_vector(7downto0));

endtraffic;

architecturebhvoftrafficis

signalcnt0,cnt1:

signall10,l20,l11,l21:

integerrange0to9;

typestate_valueis(s1,s2,s3,s4,s5,s6);

signalstate:

state_value;

process(clk,rst,rst1,rst2)

ifrst='

state<

=s1;

--S,NtravelE,Wstop

cnt0<

=11;

cnt1<

=7;

q<

="

10000001"

elsifrst1='

=s5;

=00;

10001000"

elsifrst2='

=s6;

01000010"

elsifrising_edge(clk)then

casestateis

whens1=>

--s1

ifcnt1=0then

=s2;

10000010"

=3;

else

=cnt0-1;

=cnt1-1;

whens2=>

--s2

=s3;

00100100"

whens3=>

--s3

ifcnt1=4then

=s4;

01000100"

whens4=>

--s4

whens5=>

--s4

whens6=>

endcase;

--endif;

l10<

=cnt0/10;

l20<

=cnt0rem10;

----JISUANSHIWEI;

GEWEI

l11<

=cnt1/10;

l21<

=cnt1rem10;

process(l10)

casel10is-------XIANSHISHIWEI

when0=>

shi0<

00111111"

--0

when1=>

00000110"

--1

when2=>

01011011"

--2

when3=>

01001111"

--3

when4=>

01100110"

--4

when5=>

01101101"

--5

when6=>

01111101"

--6

when7=>

00000111"

--7

when8=>

01111111"

--8

when9=>

01101111"

--9

process(l20)

casel20is--------XIANSHIGEWEI

ge0<

process(l11)

casel11is-------XIANSHISHIWEI

shi1<

process(l21)

casel21is--------XIANSHIGEWEI

ge1<

---------------------------2xuan1-----------

libraryieee;

entitymux

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

当前位置:首页 > 工程科技 > 建筑土木

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1