Altera_Forum
Honored Contributor
7 years agoquestion about Altera Cyclone 2
Hey guys,
I want to know, if the Altera Cyclone 2 (EP2C5F256C8N) is able to handle an external 100 MHz trigger. I want to count the times the trigger is fired, and as far as I know it should be fired with a frequency of 100 MHz. I hope you can help me. My code in verilog for the counter is like follows:module cntr(
input trigger,
input rst,
output counter
);
reg counter_d, counter_q;
assign counter = counter_q
always @(counter_q) begin
counter_d = counter_q + 1'b1;
end
always @(posedge trigger) begin
if (rst) begin
counter_q <= 16'b0;
end else begin
counter_q <= counter_d;
end
end
end