/* D 触发器(D Flip-Flop) Verilog */ module DFF ( input wire clk, input wire rst_n, // 低电平复位 input wire d, output reg q ); always @(posedge clk or negedge rst_n) begin if (!rst_n) q <= 0; else q <= d; end endmodule