【单选题】接上题,阅读下列关于秒计数模块的代码,下列说法正确的是( )。always @(posedge clk or posedge reset)beginif(reset==1'b1) begin {s_h,s_l}<=8'h00;else beginif(flag==1'b1) beginif(s_l==4'd9) begins_l<=4'd0;if(s_h==4'd5) begins_h<=4'...
A.
这个always语句块中包含3层if嵌套
B.
这个秒计数器是个异步计数器
C.
如下代码与题干代码功能相同: always @(posedge clk or posedge reset) begin if(reset==1'b1) begin {s_h,s_l}<=8'h00; else begin if(flag==1'b0) begin if(s_l==4'd9 && s_h==4'd5 ) begin s_l<=4'd0; s_h<=4'd0; end else if (s_l==4'd9 ) begin s_l<=4'd0; s_h<=s_h+1'b1; end else s_l<=s_l+1'b1; end end end end
D.
如下代码与题干代码功能相同: always @(posedge clk or posedge reset) begin if(reset==1'b1) begin {s_h,s_l}<=8'h00; else begin if(flag==1'b1) begin if(s_l==4'd9 && s_h==4'd5 ) begin s_l<=4'd0; s_h<=4'd0; end else if (s_l==4'd9 ) begin s_l<=4'd0; s_h<=s_h+1'b1; end else s_l<=s_l+1'b1; end end end end