欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
基于verilog語言的交通信號燈設計分享
[打印本頁]
作者:
15636337107
時間:
2018-7-22 08:00
標題:
基于verilog語言的交通信號燈設計分享
一、對一個南北向和東西向十字路口車輛信號燈和人行道信號燈的顯示進行控制,車輛信號燈為紅黃綠三色,顯示順序為綠黃紅循環顯示,人行道信號燈為紅綠兩色。南北向為主干道,車輛信號燈顯示時間依次為綠燈
90
秒,黃燈
5
秒,紅燈
40
秒,交通燈點亮的同時
2
位
LED
燈倒計數顯示該等剩余秒數,當車輛信號燈點亮綠燈時同時點亮人行道信號燈的綠燈,點亮時間為
80
秒,接著綠燈閃爍
10
秒,閃爍頻率
1Hz
,然后點亮紅燈
45
秒,如此依次進行。東西向車輛信號燈顯示時間依次為綠燈
35
秒,黃燈
5
秒,紅燈
95
秒,交通燈點亮的同時
2
位
LED
燈倒計數顯示該等剩余秒數,當車輛信號燈點亮綠燈時同時點亮人行道信號燈的綠燈,點亮時間為
25
秒,接著綠燈閃爍
10
秒,閃爍頻率
1Hz
,然后點亮紅燈
100
秒,如此依次進行。
二、實驗環境:
本次實驗采用
Cyclone IV EP4CE115F29
芯片
,
系統時鐘為
50MHz
。
實驗環境為:
1
、
PC
機一臺。
2
、
Altera
的
Quartus
軟件一套。
3
、主芯片為
Altera
公司的
DE2-115
的
EDA
開發板一套。
0.png
(47.75 KB, 下載次數: 105)
下載附件
2018-7-23 00:51 上傳
verilog源碼:
module traffic_led(clkin,con11,con12,con21,con22,t11,t12,t21,t22);
input clkin;
output con11,con12,con21,con22,t11,t12,t21,t22;
reg [1:0] con11,con12,con21,con22;
reg [3:0] t11,t12,t21,t22;
reg [7:0] tcont,tout1,tout2; //剩余時間: t11:高位南北,t12:低位南北,t21:高位東西,t22:低位東西// //con11:南北車道,con12:南北人行,con21:東西車道,con22:東西人行//
always@(posedge clkin)
begin
tcont<=tcont+1;
if(tcont<=80)
begin
con11<=0;
con12<=0;
con21<=2;
con22<=2;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else if(tcont<=90)
begin
con11<=0;
con12<=1;
con21<=2;
con22<=2;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else if(tcont<=95)
begin
con11<=1;
con12<=2;
con21<=2;
con22<=2;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else if(tcont<=120)
begin
con11<=2;
con12<=2;
con21<=0;
con22<=0;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else if(tcont<=130)
begin
con11<=2;
con12<=2;
con21<=0;
con22<=1;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else if(tcont<=135)
begin
con11<=2;
con12<=2;
con21<=1;
con22<=2;
t11<=tout1/10;
t12<=tout1-(tout1/10)*10;
t21<=tout2/10;
t22<=tout2-(tout2/10)*10;
end
else
tcont<=0;
end
always@(posedge clkin)
begin
if(tcont<=90)
begin
tout1<=90-tcont;
tout2<=95-tcont;
end
else if(tcont<=95)
begin
tout1<=95-tcont;
tout2<=95-tcont;
end
else if(tcont<=130)
begin
tout1<=135-tcont;
tout2<=130-tcont;
end
else if(tcont<=135)
begin
tout1<=135-tcont;
tout2<=135-tcont;
end
end
endmodule
復制代碼
全部資料51hei下載地址:
traffic_led.zip
(3.68 MB, 下載次數: 110)
2018-7-22 07:58 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
862422207
時間:
2019-7-16 14:53
代碼用不了啊
作者:
15636337107
時間:
2019-8-1 22:45
862422207 發表于 2019-7-16 14:53
代碼用不了啊
一共有3個模塊組成,分頻,顯示,交通時序,朋友是不是沒用全?
作者:
123哈哈哈哈
時間:
2019-12-8 00:11
862422207 發表于 2019-7-16 14:53
代碼用不了啊
不能運行嗎
作者:
委曲求全
時間:
2020-4-1 21:12
兄弟,能不能進行時序仿真
作者:
委曲求全
時間:
2020-4-1 21:17
這個是沒有寫testbench嗎
作者:
150292
時間:
2020-12-20 20:48
作者看到能會復一下嗎
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1