Forum Discussion
Altera_Forum
Honored Contributor
16 years agoThere is a one clock latency on reading the RAM. The read address is latched on one clock with the read data being available on the following clock:
Change this:always @(posedge clk)
begin
if (reset)
begin
rdx = 0;
end
else
begin
ledbuffer = rddata;
rdx = rdx+3'b1;
end
end
to this:
reg rdx_r;
always @(posedge clk or posedge reset)
if (reset) begin
rdx <= 3'd0;
rdx_r <= 3'd0;
end else begin
ledbuffer <= rddata;
rdx <= rdx+3'd1;
rdx_r <= rdx;
end