Вы находитесь на странице: 1из 1

/*

* FILE : Contador.v
* FUNCTION : Contador 4bits
* AUTHOR : Miguel Gomez
*/
module Contador (
input Clk_50,
input Enable,
input Rst_n ,
output wire Tick,
output reg [5-1:0] Count
);

//Contador de 16 ticks
always @(posedge Clk_50 or negedge Rst_n)
begin
if(!Rst_n) Count <= 5'b00000;
else if (Enable) Count <= Count+5'b00001;
else Count <= Count;
end
assign Tick = Count==5'd16;
endmodule

Вам также может понравиться