verilog hdl 怎么转换成vhdl
程序:always@(posedgeclk_inornegedgereset)beginif(!reset)begincnt_clk_in<=0;state_w<=ste...
程序:
always @ (posedge clk_in or negedge reset)
begin
if(!reset)
begin
cnt_clk_in <= 0;
state_w <= stept0;
{w1,w2} <=2'bol;
end
else
begin
cnt_clk_in <= cnt_clk_in + l;
cnt_ww <= cnt_ww + 1;
case(state_w)
stept0:
begin
state_w <= steptl;
w1 <= 1;
w2 <= 0;
end
stept1:
begin
case(cnt_clk_in)
s2:
begin
w1 <= 0;
w2 <= l;
end
150:
begin
state_w <= stept2;
cnt_clk_in <= 0;
w1 <= 1;
w2 <= 0;
end
endcase
end
stept2:
begin
if(cnt_ww == s3)
begin
cnt_ww <= 0;
state_w <= stept0;
cnt_clk_in <= 0;
end
else
if(cnt_elk_in == s2)
begin
cnt_clk_in <= 0;
w1 <=~w1;
w2 <=~w2;
end
end
endcase
end
end 展开
always @ (posedge clk_in or negedge reset)
begin
if(!reset)
begin
cnt_clk_in <= 0;
state_w <= stept0;
{w1,w2} <=2'bol;
end
else
begin
cnt_clk_in <= cnt_clk_in + l;
cnt_ww <= cnt_ww + 1;
case(state_w)
stept0:
begin
state_w <= steptl;
w1 <= 1;
w2 <= 0;
end
stept1:
begin
case(cnt_clk_in)
s2:
begin
w1 <= 0;
w2 <= l;
end
150:
begin
state_w <= stept2;
cnt_clk_in <= 0;
w1 <= 1;
w2 <= 0;
end
endcase
end
stept2:
begin
if(cnt_ww == s3)
begin
cnt_ww <= 0;
state_w <= stept0;
cnt_clk_in <= 0;
end
else
if(cnt_elk_in == s2)
begin
cnt_clk_in <= 0;
w1 <=~w1;
w2 <=~w2;
end
end
endcase
end
end 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询