交通灯设计Verilog代码Quartus 远程云端平台

名称:交通灯设计Verilog代码Quartus  远程云端平台

软件:Quartus

语言:Verilog

代码功能:

交通灯设计

主支干道车辆按规定时间交替运行,主干道每次通行 30秒,支干道每次通行 20秒,每次绿灯转红灯前要求黄灯亮 5秒,而红灯保持不变

用发光二极管模拟两组红绿灯。用七段显示器显示每种状态持续的时间。 黄灯亮时按 1H频率闪烁,加装使系统归零按键,加装蜂鸣器 (绿灯亮1秒响结束前 2秒停)


FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com

本代码已在远程云端平台验证,远程云端平台如下,其他开发板可以修改管脚适配:远程云端平台.png

演示视频:

设计文档:

设计文档.doc

1. 工程文件


2. 程序文件





3. 程序编译


4. RTL图


5. 管脚分配


6. Testbench


7. 仿真图

整体仿真图


分频模块


控制模块


倒计时模块


显示模块


部分代码展示:

/*
红->绿 绿->黄 黄->红
1、红--计时main_red_times------------------------绿--计时main_green_times---main_yellow_times黄灯---------------红
2、绿--计时branch_green_times---branch_yellow_times黄灯--------------------红--计时branch_reg_times-------------------绿
*/
module traffic_light(
input clk,//1M
input reset,//复位----
//led 0亮1灭
output main_red,//主路灯
output main_green,//主路灯--
output main_yellow,//主路灯--
output branch_red,//支路灯--
output branch_green,//支路灯--
output branch_yellow,//支路灯--
output beep,//蜂鸣器
output [3:0] weixuan,//数码管位选
output [7:0] duanxian//数码管段选
);
 wire clk_1Hz;
 wire [7:0] main_green_BCD;
 wire [7:0] main_yellow_BCD;
 wire [7:0] main_red_BCD;
 wire [7:0] branch_green_BCD;
 wire [7:0] branch_yellow_BCD;
 wire [7:0] branch_red_BCD;
 wire [7:0] main_data_out;
 wire [7:0] branch_data_out;
 
wire main_red_led;//主路灯
wire main_green_led;//主路灯
wire main_yellow_led;//主路灯

代码文件(付费下载):



1、代码文件需要付费后才可见。
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 交通灯设计Verilog代码Quartus 远程云端平台

发表评论

模板文件不存在: ./template/plugins/comment/pc/index.htm

注册为本站会员,充值100得150,详情咨询客服

目前为止共有 *** 位优秀的会员加入! 立刻加入会员