Forum Discussion
Altera_Forum
Honored Contributor
17 years agoYou could use 2 FF's to screen instead of the latch (for a total of 3) -
always @(posedge clk or posedge aclr) if (aclr) aclr_ff <= 1'b0; else aclr_ff <= 1'b1; always @(posedge clk or posedge apre) if (apre) apre_ff <= 1'b0; else apre_ff <= 1'b1; always @(posedge clk) d_ff <= din; assign q = aclr_ff & (!apre_ff | d_ff); This isn't exactly equivalent if you clear, then preset before the next clock tick. It also has more timing critical signals to route than the latch version.