verilog代码
module fp(clk,rst_n,fm,led1,led2);input clk,rst_n;
output fm;
output led1,led2;
reg cnt;
always @(posedge clk or negedge rst_n)
begin
if(!rst_n)cnt<=22'd0;
else cnt<=cnt+1'b1;
end
assignfm=cnt;
endmodule
cnt加满了会怎么样? 最高位溢出,其他位继续累加
页:
[1]