on-internet
← Community

Why I can not copy a content of register to another one in "always" block?

Stack Overflow ·

I have this code that is working perfectly: module syncRX(clk, signal, detect); input clk, signal; output reg [7:0] detect = 0; reg [7:0] delay = 0; //wire clk_1khz; freq_div div(.clk(clk), .clk_1khz(clk_1khz)); always @(posedge signal) begin detect <= detect + 1; delay <= 0; end always @(posedge clk_1khz) begin delay <= delay + 1; end endmodule // top module freq_div(input clk, output reg clk_1khz); reg [12:0] count = 0; always @(posedge clk) begin if(count == 6000) begin clk_1khz <= ~clk_1khz; count <= 0; end else count <= count + 1; end endmodule The problem appears when I change the line d

Comments

Sign in or sign up to comment and upvote.

No comments yet.