Hi, Nick!
Thank you very much. Your code means that I have to transform my 3-bit shifter to 3 64-bit registers and to shift the signals simultaneously. Great!
But what do you mean with your last sentece?
if the signals are all changing at the same time, it's not guaranteed to give a "consistent snapshot"
My problem is: I have a 64-bit input port which signals are of course external to the logic. So I have to make these signals synchronous with the CPLD clock domain. I want to generate an interrupt signal (a flag) whenever ANY of those 64 bits change at any time. It is needed for to be able to inform the external circuit that something happens. Do you think it's feasible? I intend to write something like this:
- Code: Select all
module oneshot(
input clk, // master clock = 50MHz
input [63:0] osin, // my 64-bit input port
output reg osout); // one-shot -> my interrupt signal
reg q;
always @(osin or posedge osout)
begin
if(osout)
q <= 0;
else
q <= 1;
end
always @(posedge clk)
osout <= q;
endmodule
This will be a one-shot circuit that produces a single pulse every time a bit from the input port changes. Below is the simulation result for the one-shot:
Thanks once more for your help!
Yassen