• 方案介绍
  • 附件下载
  • 相关推荐
申请入驻 产业图谱

倒计时交通灯设计Verilog代码Quartus ep1c3开发板

09/24 07:54
351
加入交流群
扫码加入
获取工程师必备礼包
参与热点资讯讨论

2-24101QT930313.doc

共1个文件

名称:倒计时交通灯设计Verilog代码Quartus  ep1c3开发板

软件:Quartus

语言:Verilog

代码功能:

倒计时交通灯

主干:绿灯60秒,黄灯闪烁5秒,红灯40秒

支干:红65,绿35,黄闪烁5

有复位,有全黄灯控制

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

本代码已在ep1c3开发板验证,ep1c3开发板如下,其他开发板可以修改管脚适配:

ep1c3开发板.jpg

演示视频:

设计文档:

顶层仿真图

分频模块

控制模块

数码管显示模块

部分代码展示:

/*
红->绿 绿->黄 黄->红
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,//50Mhz
input reset_n,//复位
input lock_key,//紧急按键
output main_red,//主路灯
output main_green,//主路灯
output main_yellow,//主路灯
output branch_red,//支路灯
output branch_green,//支路灯
output branch_yellow,//支路灯
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 clk_2Hz;
 
wire main_red_led;//主路灯
wire main_green_led;//主路灯
wire main_yellow_led;//主路灯
wire branch_red_led;//支路灯
wire branch_green_led;//支路灯
wire branch_yellow_led;//支路灯
assign main_red=main_red_led;//主路灯
assign main_green=main_green_led;//主路灯
assign main_yellow=main_yellow_led;//主路灯
assign branch_red=branch_red_led;//支路灯
assign branch_green=branch_green_led;//支路灯
assign branch_yellow=branch_yellow_led;//支路灯

点击链接获取代码文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=1236

  • 2-24101QT930313.doc
    下载

相关推荐