- 7
- 0
- 约2.75千字
- 约 5页
- 2018-06-27 发布于河南
- 举报
交通灯报告及VHDL源程序
一、系统功能概述
利用VHDL语言设计一个十字路口交通灯控制器,分成两个方向,六个灯。三个灯按合理的顺序亮灭。
两个方向的灯亮时间可以进行调节。
二、系统组成以及系统各部分的设计
1、系统结构描述
2)用VHDL语言实现的,报告需包含以下内容:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;--调用库文件
entity traffic_ctrl is--定义实体
generic(
green1_cnt:integer:=25;--定义变量
yellow1_cnt:integer:=5;
green2_cnt:integer:=15;
yellow2_cnt:integer:=5
);
port(--定义输入输出节点
clk: in std_logic;--时钟信号
rst: in std_logic;--复位
lgt1_red: out std_logic;--1号红灯
lgt1_yellow: out std_logic;--一号黄灯
lgt1_green: out std_logic;--一号绿灯
lgt2_red: out std_logic;--2号红灯
lgt2_yellow: out std_logic;--2号黄灯
lgt2_green:out std_logic
原创力文档

文档评论(0)