jiu jiang university
eda设计实习报告。
专业。班级。
学号。学生姓名。
指导教师。设计时间: 6月4 号 — 6月8号
eda设计实习。
一、课程设计的要求:
1.了解电子设计的具体流程和方法。
2. 掌握电子设计的基本要求,能够运用所学的知识解决生活中的一些问题。
3. 初步掌握vhdl语言编程,并设计出一个有意义的小型系统。
4. 用eda或者原理图完成一个课题的设计,并达到相应的功能要求。
二、设计内容与目的:
用eda设计一个简单的交通灯控制器,具有如下功能:
1. 设计一个交通信号灯控制器,由一条主干道和一条支干道汇合成十字路口,在每个入口处设置红、绿、黄三色信号灯,红灯亮禁止通行,绿灯亮允许通行,黄灯亮则给行驶中的车辆有时间停在禁行线外。
2. 用红、绿、黄发光二极管作信号灯,用传感器或逻辑开关作检测车辆是否到来的信号。
3. 主干道处于常允许通行的状态,支干道有车来时才允许通行。主干道亮绿灯时,支干道亮红灯;支干道亮绿灯时,主干道亮红灯。
主、支干道均有车时,两者交替允许通行,主干道每次放行45秒,支干道每次放行25秒,设立45秒、25秒计时、显示电路。
4. 在每次由绿灯亮到红灯亮的转换过程中,要亮5秒黄灯作为过渡,使行驶中的车辆有时间停到禁行线外,设立5秒计时、显示电路。
三、设计思路:
1. 主、支干道用传感器检测车辆到来情况,实验电路用逻辑开关代替。
2. 45秒、25秒、5秒定时信号可用顺计时,也可用倒计时,计时起始信号由主控电路给出,定时结束信号也输入到主控电路,由主控电路启、闭三色信号灯或启动另一计时电路。
3. 主控电路是核心,这是一个时序电路,其输入信号为:车辆检测信号(a,b);
4. 45秒、25秒、5秒定时信号(c,d,e)。其状态转化图如下所示:
交通灯控制器状态表:
四.电路原理图:
五.功能电路的设计:
设计总体框图:
细化的设计总体框图:
根据设计要求和系统所具有功能,并参考相关的文献资料经行方案设计画出如下所示的十字路**通灯控制器系统框图,及为设计的总体方案,框图如下图3.1所示。
灯控制器电路设计:
由一条主干道和一条支干道汇合成十字路口,在每个入口处设置红、绿、黄、左拐允许四盏信号灯,红灯亮禁止通行,绿灯亮允许通行,黄灯亮则给行驶中的车辆有时间停在禁行线外,左拐灯亮允许车辆向左拐弯。信号灯变换次序为:主支干道交替允许通行,主干道。
每次放行40s,亮5s红灯让行驶中的车辆有时间停到禁行线外,左拐放行15秒,亮5s红灯;支干道放行30s,亮5s黄灯,左拐放行15秒,亮5s红灯,其中主支干道的红黄绿灯表示如mr、my、mg、br、by、bg。
程序如下:library ieee;
use entity jtdkz is
port(clk,sm,sb:in std_logic;
mr,my,mg,br,by,bg:out std_logic);
end entity jtdkz;
architecture art of jtdkz is
type state_type is(a,b,c,d);
signal state:state_type;
begincnt:process(clk)is
variable s:integer range 0 to 45;
variable clr,en:bit;
beginif(clk'event and clk='1') then
if clr='0'then
s:=0;elsif en='0'then
s:=s;else
s:=s+1;
end if;
case state is
when a=>mr<='0';my<='0';mg<='1';
br<='1';by<='0';bg<='0';
if(sb and sm)='1'then
if s=45 then
state<=b;clr:='0';en:='0';
elsestate<=a;clr:='1';en:='1';
end if;
elsif(sb and (not sm))=1'then
state<=b;clr:='0';en:='0';
elsestate<=a;clr:='1';en:='1';
end if;
when b=>mr<='0';my<='1';mg<='0';
br<='1';by<='0';bg<='0';
if s=5 then
state<=c;clr:='0';en:='0';
elsestate<=b;clr:='1';en:='1';
end if;
when c=>mr<='1';my<='0';mg<='0';
br<='0';by<='0';bg<='1';
if(sm and sb)='1'then
if s=25 then
state<=d;clr:='0';en:='0';
elsestate<=c;clr:='1';en:='1';
end if;
elsif sb='0'then
state<=d;clr:='0';en:='0';
elsestate<=c;clr:='1';en:='1';
end if;
when d=>mr<='1';my<='0';mg<='0';
br<='0';by<='1';bg<='0';
if s=5 then
state<=a;clr:='0';en:='0';
elsestate<=d;clr:='1';en:='1';
end if;
end case;
end if;
end process cnt;
end architecture art;
分频器的设计:
将48mhz的频率分为1hz的频率,其模块如下:
程序如下:library ieee;
use use
entity fp48m is
port(clk_48mhz: in std_logic;
clk_1hz: out std_logic
end fp48m;
architecture beh** of fp48m is
signal clk_1hz_r: std_logic;
signal count : std_logic_vector(24 downto 0);
begin
process (clk_48mhz)
begin
if clk_48mhz'event and clk_48mhz='1' then
if count="1011011100011010111111111"then
count<=(others=>'0');
clk_1hz_r<=not clk_1hz_r;
else count<=count+1;
clk_1hz<=clk_1hz_r;
end if;
end if;
end process;
end beh**;
计数器的设计:
根据路上状况,设计各个显示计时部分,包括45s、25s和5s,各部分采用顺时计数方法。各模块如下:
程序如下:library ieee;
use use
entity cnt45s is
portsb,clk,en45:in std_logic;
dout45m,dout45b:out std_logic_vector(7 downto 0));
end entity cnt45s;
architecture art of cnt45s is
signal cnt6b:std_logic_vector(5 downto 0);
beginprocess(sb,clk,en45) is
beginif sb='0' then cnt6b<=cnt6b-cnt6b-1;
elsif(clk'event and clk='1')then
if en45='1' then cnt6b<=cnt6b+1;
elsif en45='0' then cnt6b<=cnt6b-cnt6b-1;
end if;
end if;
end process;
process(cnt6b)is
begincase cnt6b is
when"000000"=>dout45m<="01000101";dout45b<="01010000";
when"000001"=>dout45m<="01000100";dout45b<="01001011";
EDA课程设计
题目一 数字钟设计 学号1 15 一 实验目的。学习并掌握数字钟的原理 设计方法。二 实验内容。计数始终由模60秒计数器 模60分计数器 模24小时计数器 报时模块 分 时设定模块及输出显示模块构成。可以采用同步计数器或异步计数器设计方法。三 实验要求。计时范围为0小时0分0秒至23小时59分59秒...
eda课程设计
哈尔滨工业大学 威海 信电学院电子信息工程。一 软硬件介绍。1软件部分介绍。1.1 quartus ii 是altera公司的综合性pld fpga开发软件,支持原理图 vhdl veriloghdl以及ahdl altera hardware description language 等多种设计输...
eda课程设计
目录。1 引言 2 1.1 课程设计的目的与任务 2 1.2 课程设计的内容 2 1.3课程设计仪器设备 2 1.4 课程设计的题目 2 1.5 方案的选择 2 2设计方案 3 2.1 设计原理 3 2.2各功能模块的原理及其源程序 3 2.2.1控制模块 3 2.2.2分频模块 4 2.2.3计时...