Skip to content

Instantly share code, notes, and snippets.

@coldcue
Created September 28, 2014 18:24
Show Gist options
  • Save coldcue/303c81e84885774af904 to your computer and use it in GitHub Desktop.
Save coldcue/303c81e84885774af904 to your computer and use it in GitHub Desktop.
module rategen(
input clk,
input rst,
output cy
);
reg [25:0] cntr;
assign cy = (cntr == 4);
//assign cy = (cntr == 49999999);
always @ (posedge clk)
begin
if( rst | cy )
cntr <= 0;
else
cntr <= cntr + 1;
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment