即使语法看起来正确,简单代码也会产生错误(ISE VERILOG)

Simple code yielding error even though syntax seems correct (ISE VERILOG)

我是 Xilinx ISE verilog 编码方面的新手(才几个小时)。这是我的 uni 项目的代码。它在 count = 0 行显示语法错误。 运行 检查语法时,我没有发现任何错误。我该如何解决这个问题?

 module syncdown(clk,rst,count);
input clk,rst;
output reg [3:0] count = 1;
always @(posedge clk);
begin
if(rst)
count = 0; // wrong here 
else
count = count-1;
end
endmodule

错误

ERROR:HDLCompiler:806 - "/home/bossman/mux/syncdown.v" Line 8: Syntax error near "=".

删除always行末尾的分号:

module syncdown(clk,rst,count);
input clk,rst;
output reg [3:0] count = 1;
always @(posedge clk)
begin
if(rst)
count = 0; // wrong here 
else
count = count-1;
end
endmodule