Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module top_module (
- input clk,
- input [7:0] in,
- output reg [7:0] anyedge
- );
- reg [7:0] aux;
- always @(posedge clk) begin
- anyedge <= aux ^ in; // Detect edge by XORing current and previous state
- aux <= in; // Update aux with the current state of 'in'
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement