2015-12-14 21:13:15 +03:00
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
// ClkDivider.v
|
|
|
|
|
// Konstantin Pavlov, pavlovconst@gmail.com
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// INFO --------------------------------------------------------------------------------
|
|
|
|
|
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
|
2016-01-01 22:39:14 +03:00
|
|
|
|
|
|
|
|
|
/*ClkDivider CD1 (
|
|
|
|
|
.clk(),
|
|
|
|
|
.nrst(),
|
|
|
|
|
.out()
|
|
|
|
|
);
|
|
|
|
|
defparam CD1.WIDTH = 32;*/
|
|
|
|
|
|
|
|
|
|
|
2015-12-14 21:13:15 +03:00
|
|
|
|
module ClkDivider(clk,nrst,out);
|
|
|
|
|
|
|
|
|
|
input wire clk;
|
|
|
|
|
input wire nrst;
|
|
|
|
|
output reg [(WIDTH-1):0] out = 0;
|
|
|
|
|
|
|
|
|
|
parameter WIDTH = 32;
|
|
|
|
|
|
|
|
|
|
always @ (posedge clk) begin
|
|
|
|
|
if (~nrst) begin
|
2016-03-23 21:18:08 +03:00
|
|
|
|
out[(WIDTH-1):0] <= 0;
|
2015-12-14 21:13:15 +03:00
|
|
|
|
end
|
|
|
|
|
else begin
|
2016-03-23 21:18:08 +03:00
|
|
|
|
out[(WIDTH-1):0] <= out[(WIDTH-1):0] + 1'b1;
|
2015-12-14 21:13:15 +03:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
endmodule
|