The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Query with regard to contribution operator
https://designers-guide.org/forum/YaBB.pl?num=1467097935

Message started by Rosh on Jun 28th, 2016, 12:12am

Title: Query with regard to contribution operator
Post by Rosh on Jun 28th, 2016, 12:12am

Here is my code :


Code:
`include "disciplines.vams"


     module test(in, out);
     input in;
     output out;
     voltage out,in;
     analog begin      
           if (V(in)==0)
                 V(out)<+1;
           else
                 V(out)<+3;

           V(out)<+1;

           end


           endmodule


This is the resulting output



In the first edge:
In=5V and Out=4V

In the second edge:
In=0V and Out=2V instead of 6V.

Since the contribution operator accumulates signal values, shouldn't Out have a potential of 6V? (4V from the previous edge)




Title: Re: Query with regard to contribution operator
Post by Ken Kundert on Jun 28th, 2016, 11:57am

The contribution operator does not accumulate over time. It adds together all of the contributions made to a branch at each instant in time. The starting point at each instant of time is not the previous value, it is always zero.

I recommend you take a look at this tutorial.

-Ken


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.