交通灯(带左转)设计Verilog代码Quartus仿真

名称:交通灯(带左转)设计Verilog代码Quartus仿真

软件:Quartus

语言:Verilog

代码功能:

交通灯(带左转)

1、主路:red=20;green=12;left=68;yellow=5

2、支路:red=19;green=05;left=68;yellow=5

3、全局使能en=1时,控制交通灯开始变化


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


演示视频:

设计文档:

设计文档.doc

1. 工程文件


2. 程序文件






3. 程序编译


4. RTL图


5. Testebnch



6. 仿真图

整体仿真图





分频模块


A路红绿灯控制模块




B路红绿灯控制模块




显示模块


部分代码展示:

//顶层模块
module traffic(
input clk_in,//40M
input rst_p,//复位
input en,//全局使能en=1开始
//红绿灯
output A_red,
output A_green,
output A_left,
output A_yellow,
//红绿灯
output B_red,
output B_green,
output B_left,
output B_yellow,
//倒计时
output [7:0] HEX0,//数码管0
output [7:0] HEX1,//数码管1
output [7:0] HEX2,//数码管2
output [7:0] HEX3//数码管3
);
wire clk_1Hz;//1Hz
//倒计时
wire [7:0] A_downcnt;
wire [7:0] B_downcnt;
//分频模块
clk_div i_clk_div(
. clk_in(clk_in),//40M
. rst_p(rst_p),//复位
. clk_1Hz(clk_1Hz)
);
//A控制模块
A_led_ctrl i_A_led_ctrl(
. clk_in(clk_in),//40M
. rst_p(rst_p),//复位
. clk_1Hz(clk_1Hz),
. en(en),//全局使能en=1开始
//红绿灯
. red   (A_red   ),
. green (A_green ),
. left  (A_left  ),
. yellow(A_yellow),
//倒计时
. downcnt(A_downcnt)
);

代码文件(付费下载):



1、代码文件需要付费后才可见。
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 交通灯(带左转)设计Verilog代码Quartus仿真

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

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