module ExtraCounter_SRBit (PHI1, PHI2, nd, n_EN, RES, nq, nsout);

	input PHI1;
	input PHI2;
	input nd;
	input n_EN;
	input RES;
	output nq;
	output nsout;

	wire latch1_q;
	wire latch2_d;

	nor (latch2_d, latch1_q, RES);
	dlatch latch1 (.d(n_EN ? nq : nd), .en(PHI1), .q(latch1_q));
	dlatch latch2 (.d(latch2_d), .en(PHI2), .nq(nq));
	assign nsout = ~latch2_d;

endmodule // ExtraCounter_SRBit