Unknown Clock Signal

Status
Not open for further replies.

sandy2811

Junior Member level 3
Joined
Jul 20, 2012
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,450
Hi,
In my simple design, I am giving some inputs and it is difficult for me to know which signal act as a clock. i.e. only "y" act as a clock or both "x" and "y" act as clock.

Code:
module my_design (q, d, x, y);
input x, y, d;
output reg q;

always@(posedge x or posedge y)
begin
 if(x)
q <= 1'b0;
else
 q <= d;
end
endmodule
 
Last edited by a moderator:

Hi,

input x, y, clk;
Maybe I didn't understant your question correctly.

There are three inputs:
* x
* y
* clk

Obviously "clk" is the clock input.

Klaus
 

Ohhh right Klaus,
I have edited that.
 

Despite of the event specification "posedge x", x is acting as level sensitive input in this well know Verilog template for a DFF with asynchronous reset.

A detailed explanation can be found in the (withdrawn) IEEE Std 1364.1 Verilog Register Transfer Level Synthesis

 

After reading this I understood the actual meaning of that always statement, Thanks, guys............



Sandy.
 

This is one of the minor things I don't like about Verilog. In VHDL, you can have registers without reset in the same process as registers with reset. The reset logic just is placed at the end of the process.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…