このVerilogコードをmodelSimに書きました。Verilogの予期しないエラー
module my_fsm (clock , reset , in , out);
input clock , reset , in;
output out;
wire clock , reset , in;
reg out;
reg [1:0] state; // state of the machine in case reset = 0
// A = 00 , B = 01 , C = 10 , D = don't care = 11
always @(posedge clock) begin
if (reset == 1'b1)
begin
state <= 2'b00;
out <= 1'b0;
end
else
begin
case (state)
2'b00:
out <= 1'b0;
if (in == 1'b1) state <= 2'b01;
2'b01:
out <= in;
if (in == 1'b0) state <= 2'b10;
if (in == 1'b1) state <= 2'b00;
2'b10:
out <= 1'b1;
if (in == 1'b0) state <= 2'b01;
default: out <= 1'bX;
endcase
end
end
endmodule
しかし、コンパイラは、私にこのコンパイルエラーを与えている:私はそれらの問題のために見上げてきたが、彼らのために任意の解決策を見つけることができませんでした
** Error: (vlog-13069) C:/Users/michael/Documents/Logic Design/hw1/my_fsm .v(22): near "if": syntax error, unexpected if.
** Error: (vlog-13069) C:/Users/michael/Documents/Logic Design/hw1/my_fsm .v(27): near "2": syntax error, unexpected INTEGER NUMBER.
** Error: (vlog-13069) C:/Users/michael/Documents/Logic Design/hw1/my_fsm .v(30): near "default": syntax error, unexpected default.
。
は、case文のブランチで マイケル