`timescale 1ns/1ns

module seq_circuit(
      input                A   ,
      input                clk ,
      input                rst_n,
 
      output   wire        Y   
);
    reg Q0,Q1;
    always@(posedge clk or negedge rst_n) begin
        if(!rst_n) begin
            {Q0,Q1} <= 2'b00;
        end
        else begin
            // {Q0,Q1} <= {~Q0,((~(Q0^Q1))&A)|(Q0^Q1)&(~A)};
            {Q0,Q1} <= {~Q0,Q0^Q1^A};
        end
    end
    assign Y = Q0 & Q1;
endmodule