module RisingEdgeDetector (
input wire signal,
input wire clk,
input wire signal_1d,
output reg flag
);
reg signal_prev;
always @(posedge clk) begin
signal_prev <= signal_1d;
if (signal && !signal_prev) begin
flag <= 1;
end else begin
flag <= 0;
end
end
endmodule
module RisingEdgeDetector (
input wire signal,
input wire clk,
input wire signal_1d,
output reg flag
);
reg signal_prev;
always @(posedge clk) begin
signal_prev <= signal_1d;
if (signal && !signal_prev) begin
flag <= 1;
end else begin
flag <= 0;
end
end
endmodule