二处错误:第一是在 count<=count+23'dl;这句,d后面是数字1,而你的是字母l。第二处是在最后一句,end module ,不应该有空格分开的,应是:endmodule
下面是修改后的:
module LED(
clk48M,
RST,
ledout
);
input clk48M;
input RST;
output ledout;
reg led_reg;
wire led_clk;
reg[22:0] count;
assign led_clk=count[22];
always@(posedge clk48M or posedge RST)
if(RST)
count<=23'd0;
else
count<=count+23'd1;
always@(posedge led_clk or posedge RST)
if(RST)
led_reg<=0;
else
led_reg<=~led_reg;
assign ledout=led_reg;
endmodule