Desired behaviour:
Objective: enable next clock edge when state reaches ‘9’
Alternatives:
always @ (posedge clk)
if (count < 9) count <= count + 1;
else count <= 0;
assign rc = (count == 9);
or
always @ (posedge clk)
if (count < 9) count <= count + 1;
else count <= 0;
always @ (posedge clk) rc <= (count == 8);
NOTE!
The second example will generate an output (slightly) sooner and without glitching.
Up/back to Tradeoffs.
Forwards to FSMs.