Skip to content

Instantly share code, notes, and snippets.

@tuna-f1sh
Last active February 25, 2023 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuna-f1sh/a0333d17ed95a3f08325c80ba30f4534 to your computer and use it in GitHub Desktop.
Save tuna-f1sh/a0333d17ed95a3f08325c80ba30f4534 to your computer and use it in GitHub Desktop.
reg [3:0] d0;
reg [3:0] d1;
always @(posedge clk)
begin
d0 <= ((d0 & 9) == 9) ? 4'b0 : d0 + 1;
if ((d0 & 9) == 9) d1 <= d1 + 1;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment