课程设计EDA

发布 2022-09-30 20:16:28 阅读 7373

eda课程设计。

实验报告。姓名:sisi

学号:2010210222

班级:0222222

一 .实验题目:

普通交通灯系统设计。

二.实验目的。

掌握电子设计自动化(eda)的基本方法和相关软件(quartus )的操作,了解程序开发的过程和细节,能够熟练的运用硬件描述语言(vhdl)进行图形设计和vhdl设计。

三. 实验要求。

(1). 用红、绿、黄三色发光二极管作信号灯。主干道为东西向,有红、绿、黄三个灯;支干道为南北向,也有红、绿、黄三个灯。

红灯亮禁止通行;绿灯亮允许通行;黄灯亮则给行驶中的车辆有时间停靠到禁行线之外。

2). 由于主干道车辆较多而支干道车辆较少,所以主干道绿灯时间较长。当主干道允许通行亮绿灯时,支干道亮红灯。

而支干道允许通行亮绿灯时,主干道亮红灯,两者交替重复。主干道每次放行50秒,支干道每次放行30秒。 在每次由亮绿灯变成亮红灯的转换过程中间,需要亮5秒的黄灯作为过渡,以使行驶中的车辆有时间停靠到禁行线以外。

3). 能实现正常的、即时显示功能。用de2上的四个七段数码管作为倒计时显示器。分别显示东西、南北方向的红灯、绿灯、黄灯时间。

四.实验内容。

1.设计方案:

(1).时钟信号周期设为1秒。

(2).用计数器(control)对时钟信号进行计时来达到对主干道、支干道的红黄绿信号灯亮灭时间的控制。经计算可知,主干道和支干道的红黄绿灯的变化以90秒为周期规律变化,因为始终周期设为1s,所以,计数器 (control)的计数最大值设为90。

(3).主干道、支干道的红黄绿信号灯分别用red0,yellow0,green0(主)和red1,yellow1,green1(干)输出信号来控制其亮灭。

(4).主干道和支干道分别用两位数码管来动态显示各色信号灯亮的时间的倒计时间。

2.实验源**。

library ieee;

use use

entity simiao is

port(clk : in std_logic;

zc : in std_logic_vector(1 downto 0);

main_shi_display1 : out std_logic_vector(6 downto 0);-xian shi na ge shu

main_ge_display1 : out std_logic_vector(6 downto 0);

minor_shi_display : out std_logic_vector(6 downto 0);

minor_ge_display : out std_logic_vector(6 downto 0);

dig : out std_logic_vector(7 downto 0);-na ge shu ma guan xian shi

left0 : out std_logic;

left1 : out std_logic;

red0 : out std_logic;

green0 : out std_logic;

yellow0 : out std_logic;

red1 : out std_logic;

green1 : out std_logic;

yellow1 : out std_logic

end entity simiao;

architecture behv of simao is

signal c : std_logic_vector(20 downto 0);

signal control :integer range 100 downto 0;

signal clkr : std_logic;

begin

dig<="00111111";

timer : process(clk)--fen pin mo kuai

beginif clk'event and clk='1' then

c<=c+1;

if(c=250000) then

clkr<=not clkr;

end if;

end if;

end process timer;

ti : process(clkr)

beginif clkr'event and clkr='1' then

if control<96 then

control<=control+1;

elsecontrol<=0;

end if;

end if;

end process ti;

main: process(control,zc)

variable n :integer range 10000 downto 0;

begin

n:=n+1;

if zc=3 then

case control is

when 0 to 50 =>green0<='0'; red0<='1'; yellow0<='1';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

when 51 to 55 =>green0<='1'; red0<='1'; yellow0<='0';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

when 56 to 65 =>green0<='1'; red0<='1'; yellow0<='1';left0<='0';

green1<='1'; red1<='1'; yellow1<='1';left1<='0';

when 66 to 90 =>green0<='1'; red0<='0'; yellow0<='1';left0<='1';

green1<='0'; red1<='1'; yellow1<='1';left1<='1';

when 91 to 95 =>green0<='1'; red0<='0'; yellow0<='1';left0<='1';

green1<='1'; red1<='1'; yellow1<='0';left1<='1';

when others =>null;

end case;

else if zc=2 then

if n>50 then

green0<='0'; red0<='1'; yellow0<='1';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

elsegreen0<='1'; red0<='1'; yellow0<='0';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

end if;

else if zc=1 then

if n>50 then

green0<='1'; red0<='0'; yellow0<='1';left0<='1';

green1<='0'; red1<='1'; yellow1<='1';left1<='1';

elsegreen0<='1'; red0<='1'; yellow0<='0';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

end if;

elsegreen0<='0'; red0<='1'; yellow0<='1';left0<='1';

green1<='1'; red1<='0'; yellow1<='1';left1<='1';

end if;

end if;

end if;

end process main;

main_disp : process(control)

variable count : integer range 90 downto 0;

variable th: integer range 9 downto 0;

variable tl: integer range 9 downto 0;

begincase control is

when 0 =>count :=50;

when 51 =>count :=5;

when 56 =>count :=10;

when 66 =>count :=35;

when others =>null;

end case;

th:=count/10;

tl:=count rem 10;

case th is

when 0 =>main_shi_display1<="1111110";

when 1 =>main_shi_display1<="0110000";

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计时...