11 assign q1_reset
= (~q1
& q3
) | reset
;
14 //q1 output decoder (simply latch the input to the input clock domain
15 always @(posedge inclk
or posedge reset
)
19 //q2 output decoder based on async q1 input
20 always @(posedge q1
or posedge q1_reset
)
21 if(q1_reset
) q2
<= 1'b0;
24 //q2 and q3 output decoders
25 always @(posedge outclk
or posedge reset
)
26 if(reset
) {q3
, q4
} <= 2'b00;
27 else {q3
, q4
} <= {q2
, q3
};