Skip to content

Instantly share code, notes, and snippets.

@coldcue
Created September 28, 2014 18:24
Show Gist options
  • Select an option

  • Save coldcue/303c81e84885774af904 to your computer and use it in GitHub Desktop.

Select an option

Save coldcue/303c81e84885774af904 to your computer and use it in GitHub Desktop.

Revisions

  1. coldcue created this gist Sep 28, 2014.
    20 changes: 20 additions & 0 deletions rategen.v
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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