//异步复位
module top(
input clk ,
input rst_n ,
input a ,
output reg b
);
always@(posedge clk or negedge rst_n)
begin
if (!rst_n)
b <= 1'b0;
else
b <= a;
end
endmodule
//异步复位
module top(
input clk ,
input rst_n ,
input a ,
output reg b
);
always@(posedge clk or negedge rst_n)
begin
if (!rst_n)
b <= 1'b0;
else
b <= a;
end
endmodule