求问fpga呼吸灯

module LEDglow(clk, LED);
input clk;
output LED;

reg [23:0] cnt;
always @(posedge clk) cnt <= cnt+1;

reg [4:0] PWM;
wire [3:0] intensity = cnt[23] ? cnt[22:19] : ~cnt[22:19];    // ramp the intensity up and down
always @(posedge clk) PWM <= PWM[3:0] + intensity;

assign LED = PWM[4];
endmodule

这段代码中为什么要让pwm[3:0]和intensity相加,以及多一个溢出位是什么意思,为什么要这么做。 

你可能感兴趣的:(fpga开发)