Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to detect that signal changed at posedge clk?

Status
Not open for further replies.

KingMoshe

Member level 2
Joined
Aug 10, 2021
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
362
Hello,
I have an input signal that can be initiate at "0" or "1".
I want to detect if the signal changed from "0" to "1" or from "1" to "0" @ posedge clock

How can I do it?

I tried:
Always @ (posedge clk) begin
if (~input_signal)
xxx = 1'b0;
end
 

Try
Code:
always @ (posedge clk) begin
input_v <= input_signal;
if (input_signal^input_v)
xxx <= 1'b0;
end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top