Hi!
I am trying to use the 50 MHz clock in the DE2 board and I have a counter which needs to increment in every second using this clock. I tried different procedures to accomplish this task but none of them seems to be working. Now I am thinking of using a clock divider to get 1 Hz from the 50 MHz clock and that I will fed into the counter's clock input. It would be really very helpful if anyone could help me in this issue. If someone have got any other idea then I would be glad even more.Thanking you in advance.
module delay_1s(delay,CLOCK_50);
output reg delay;
input CLOCK_50;
reg [25:0] count;
always @(posedge CLOCK_50)
begin
if(count==26'd49_999_999)
begin
count<=26'd0;
delay<=1;
end
else
begin
count<=count+1;
delay<=0;
end
end
endmodule
Both of you are beginners on this forum as I see, but on good way that helping each other.
If you want more points (more possibilities) click on "helpful" if threate is helpful!