Verilog语言实现设计交通灯控制器Word文档下载推荐.docx
- 文档编号:1455156
- 上传时间:2023-04-30
- 格式:DOCX
- 页数:3
- 大小:22.24KB
Verilog语言实现设计交通灯控制器Word文档下载推荐.docx
《Verilog语言实现设计交通灯控制器Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《Verilog语言实现设计交通灯控制器Word文档下载推荐.docx(3页珍藏版)》请在冰点文库上搜索。
moduleZTJ(clk,s,count1,count2,led);
parameters0=6'
b010100,s1=6'
b001100,s2=6'
b100010,s3=6'
b100001,s4=6'
b100100;
inputclk,s;
output[3:
0]count1;
0]count2;
output[5:
0]led;
reg[3:
reg[5:
0]st;
0]jicun;
0]i;
always@(posedgeclk)
if(s==0&
led==6'
b000000)
begin
led<
=s0;
st<
count1<
=4'
b0110;
count2<
b1001;
end
elseif(s==0&
led!
=6'
case(st)
s0:
if(count1!
b0000)beginled<
count1<
=count1-1;
count2<
=count2-1;
endelsebegincount1<
b0010;
st<
=s1;
end
s1:
=s2;
s2:
if(count2!
endelsebegincount2<
=s3;
s3:
default:
led<
=s4;
endcase
else
jicun<
=led;
=count1;
=count2;
i<
=i+1;
if(i==4'
b1001)
led<
=jicun;
endmodule
//译码器
moduleDECL7S(A,LED7S);
input[3:
0]A;
output[6:
0]LED7S;
reg[6:
always@(A)
begin
case(A)
4'
b0000:
LED7S<
=7'
b0111111;
b0001:
b0000110;
b0010:
b1011011;
b0011:
b1001111;
b0100:
b1100110;
b0101:
b1101101;
b0110:
b1111101;
b0111:
b0000111;
b1000:
b1111111;
b1001:
b1101111;
b1010:
b1110111;
b1011:
b1111100;
b1100:
b0111001;
b1101:
b1011110;
b1110:
b1111001;
b1111:
b1110001;
default:
LED7S<
endcase
end
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Verilog 语言 实现 设计 交通灯 控制器
![提示](https://static.bingdoc.com/images/bang_tan.gif)