A simple Verilog question about rising edge of a signal

Status
Not open for further replies.

nervecell_23

Member level 1
Joined
Apr 26, 2013
Messages
38
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,565
Hi guys,

I want to set a signal HIGH for only one clock cycle at the rising edge of another signal, can I use the following code?
Code:
always@((posedge clk)&&(posedge SIGNAL))
begin
    .......
end

Thanks!
 

Can you explain it more? Do you want to set a signal using two clocks?
 

Assume you need an edge detecting circuit.


Code:
assign out = Q1 & (!Q2);
always @(posedge clk or negedge rst)
	if (!rst)
		begin
			Q1 <= 1'b0;
			Q2 <= 1'b0;
		end
	else
		begin
			Q1 <= In;
			Q2 <= Q1;
		end
 

I think you can. But how you are going to limit it for one clock cycle?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…