Created
September 10, 2013 09:54
-
-
Save tothandras/6507303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`timescale 1ns / 1ps | |
////////////////////////////////////////////////////////////////////////////////// | |
// Company: | |
// Engineer: | |
// | |
// Create Date: 10:30:49 09/10/2013 | |
// Design Name: | |
// Module Name: rategen | |
// Project Name: | |
// Target Devices: | |
// Tool versions: | |
// Description: | |
// | |
// Dependencies: | |
// | |
// Revision: | |
// Revision 0.01 - File Created | |
// Additional Comments: | |
// | |
////////////////////////////////////////////////////////////////////////////////// | |
module rategen( | |
input clk, | |
input rst, | |
output cy | |
); | |
reg [25:0] g; | |
always @ (posedge clk) begin | |
if (rst | cy) | |
g <= 0; | |
else | |
g <= g+1; | |
end | |
assign cy = (g == 4999999); | |
//assign cy = (g == 5); | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment