end
end
//控制B方向4种灯的模块,模块的语言描述与方向A的描述基本一致,这里不再重复注释
always @(posedge CLK) begin
if (EN) begin
if(!tempb) begin
tempb<=1;
case (countb)
0: begin
numb<=bred;
LAMPB<=8;
countb<=1;
end
1: begin
numb<=bgreen;
LAMPB<=2;
countb<=2;
end
2: begin
numb<=byellow;
LAMPB<=4;
countb<=3;
end
3: begin
numb<=bleft;
LAMPB<=1;
countb<=4;
end
4: begin
numb<=byellow;
LAMPB<=4;
countb<=0;