+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Junior Member level 2
    Points: 1,192, Level: 7

    Join Date
    Jul 2012
    Posts
    22
    Helped
    0 / 0
    Points
    1,192
    Level
    7

    Unknown Clock Signal

    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 KlausST; 14th May 2018 at 07:26. Reason: added code tags

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 66,089, Level: 62
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,444
    Helped
    3101 / 3101
    Points
    66,089
    Level
    62

    Re: Unknown Clock Signal

    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
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisment

        
       

  3. #3
    Junior Member level 2
    Points: 1,192, Level: 7

    Join Date
    Jul 2012
    Posts
    22
    Helped
    0 / 0
    Points
    1,192
    Level
    7

    Re: Unknown Clock Signal

    Ohhh right Klaus,
    I have edited that.



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 248,140, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,156
    Helped
    13131 / 13131
    Points
    248,140
    Level
    100

    Re: Unknown Clock Signal

    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

    Click image for larger version. 

Name:	DFF with reset.png 
Views:	8 
Size:	459.3 KB 
ID:	146623


    1 members found this post helpful.

  5. #5
    Junior Member level 2
    Points: 1,192, Level: 7

    Join Date
    Jul 2012
    Posts
    22
    Helped
    0 / 0
    Points
    1,192
    Level
    7

    Re: Unknown Clock Signal

    Quote Originally Posted by FvM View Post
    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

    Click image for larger version. 

Name:	DFF with reset.png 
Views:	8 
Size:	459.3 KB 
ID:	146623
    After reading this I understood the actual meaning of that always statement, Thanks, guys............



    Sandy.



    •   AltAdvertisment

        
       

  6. #6
    Advanced Member level 3
    Points: 5,550, Level: 17

    Join Date
    Feb 2015
    Posts
    920
    Helped
    263 / 263
    Points
    5,550
    Level
    17

    Re: Unknown Clock Signal

    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.



--[[ ]]--