抱歉,如果此类问题已经提出。
我一直在寻找几天的帮助。
我在参数行附近遇到错误。说 ERROR:HDLCompiler:806 - ";" 附近的语法错误。和“(”附近的另一个错误(状态)语法错误。但我觉得它不是语法错误。
`timescale 1ns / 1ps
module movSeven(Clk, Rst, A, an0, an1, an2, an3 );
input A;
output reg an0, an1, an2, an3;
input Clk, Rst;
parameter W = 1, X = 2, Y = 3, Z = 4 ;
reg [1:0] State, StateNext;
always @(State, A) begin
case(State)
W:begin
an0 <= 0;
if (A == 0)
StateNext <= W;
else
StateNext <= X;
end
X:begin
an1 <= 0;
if (A == 0)
StateNext <= X;
else
StateNext <= Y;
end
Y:begin
an2 <= 0;
if (A == 0)
StateNext <= Y;
else
StateNext <= X;
end
Z:begin
an3 <= 0;
if (A == 0)
StateNext <= Z;
else
StateNext <= W;
end
endcase
end
always @(posedge Clk)
begin
if (Rst == 1)
State <= X;
else
State <= StateNext;
end
endmodule