// Synthesizable, zero-delay generic circuit. Segment order: { g, f, e, d, c, b, a }.

module basic_dff
(
    input              clk,
    input              rst,
    input              d,
    output logic       q,
    output             qn
);

    always_ff @ (posedge clk or posedge rst)
        if (rst)
            q <= 1'b0;
        else
            q <= d;

    assign qn = ~ q;

endmodule
