- reg typethea = 0; // Whether we have typed the A.
- reg statekick = 0; // State needs to be kicked back to 3'b010 on the next mclk.
-
- // This is guaranteed to converge after two pixclks.
- //always @(negedge mclk)
- // if (pixclk && !typethea) begin
- // typethea <= 1;
- // statekick <= 1;
- // end else if (typethea) begin // This is the edge of the falling anus.
- // typethea <= 0;
- // statekick <= 0;
- // end
+
+ // We detect when the state should be poked by a high negedge followed
+ // by a high posedge -- if that happens, then we're guaranteed that the
+ // state following the current state will be 3'b100.
+ reg lastneg;
+ always @(negedge mclk)
+ lastneg <= pixclk;