cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
956 Views
Registered: ‎07-26-2016

What does this timedelay code mean?

Hi, here's a simple piece of code and the resulting waveform puzzles me a little bit. Please help.

 

module test_tb;
    reg a;
    wire a2, b2, out2;

    always begin
        a = 0;
        #5;
        a = ~a;
        #5;
    end

    assign a2 = a;
    assign b2 = 1;

    and #(5, 7) g2(out2, a2, b2);endmodule

QQ图片20180615205427.png

Why red line in the middle?

Why out2 keeps being 1, instead of keeping in line with a2, after 10 time units (as I measure)?

How does #(5, 7) work?

Thank you!

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
901 Views
Registered: ‎04-24-2013

Hi @cmpt_design,

 

I believe that it is a rsie fall time setting e.g. from the language reference manual:

 

or #(4, 3) ig (o, a, b); /* or gate called ig (instance name); rise time = 4, fall time = 3 */

 

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
Highlighted
Moderator
Moderator
890 Views
Registered: ‎05-31-2017

Hi @cmpt_design,

 

As specified by @amaccre, those delays correspond to the gate level delays.

In general, it has three delays Rise, fall and turnoff.

 

The rise delay is a delay with a gate output transition to 1 from other values (0, x, z).

The fall delay is a delay with a gate output transition to 0 from other values  (1, x, z).

The Turn-off delay is a delay with a gate output transition to z from other values  (0, 1, x).

 

If you specify only one delay then it considers same for all Rise, fall and typical.

Ex:- and #1 b2(out2,a2,b2) --> Rise=1, Fall=1, Turnoff=1;

If you specify two delays then it considers for Rise and fall alone.

Ex:- and #(1,2) b2(out2,a2,b2) --> Rise=1, Fall=2;

If you specify three delays then it considers for all Rise, fall and typical delays.

Ex:- and #(1,2,3)  b2(out2,a2,b2) --> Rise=1, Fall=2, Turnoff=3;

 

Thanks & Regards,
A.Shameer

0 Kudos
Highlighted
Observer
Observer
715 Views
Registered: ‎07-26-2016

Yeah, that makes good sense.

But I'm still confused as to the red line at the first 10 time units

and the result's remaining unchanged

0 Kudos
Highlighted
Observer
Observer
710 Views
Registered: ‎07-26-2016

Yeah, that makes good sense, rise & fall delay.

But I'm still confused as to the red line during the first 10 time units

and the result's remaining unchanged.

0 Kudos