• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Mixed-Signal Design
  3. using AND gate expression in notepad for using as vpwlf...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 64
  • Views 15730
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using AND gate expression in notepad for using as vpwlf source

Charanraj Mohan
Charanraj Mohan over 8 years ago

Hi,

  I want to use AND function of two variables in the notepad, where I write the TIME & MAGNITUDE of the data points in vpwlf source that, I want to generate pulse. Is this possible ??

If the above one line is not understood, I am explaining, what I am doing. I am generating a user-defined pwl pulse using vpwlf from AnalogA library. I observed that we can take the variable that we define in the instance to the ADE-L and define there. I want to write a skill set function for AND logic in the notepad itself, where I write the data points. Is this possible ?? Suppose there are three data points - (t1,g1), (t2,g2) & (t3,a). I want that a should be the AND function of g1 & g2. And all these should be coded in the notepad where I define the data points. Is this possible ???

Thanks in advance

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I think the answer is probably no, but I don't really understand what you're asking - it's very unclear.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Charanraj Mohan
    Charanraj Mohan over 8 years ago

    Thanks Andrew.

    I am defining three data points in vpwlf such that-

    t1 g1

    t2 g2

    t3 a

    Suppose, I define g1 = HIGH (= 3.3 V) & g2 = LOW (= 0 V) in ADE- L, where I have taken the variable. I want to do a AND logic function for the variable 'a', such that a = g1 AND g2. So I am looking for a skillset in the notepad to write something like 'g1ANDg2' instead of 'a' in the notepad, so that I avoid the 3rd variable completely. Is this possible ?? If not is there any other instance or sources in the analog library where I can do this ??

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    An AND on voltage values is a bit ambiguous, but you can put expressions in the PWL file. So putting this in your PWL file would work:

    t1 g1
    t2 g2
    t3 (g1>1.65 && g2>1.65)*3.3

    The last expression just determines that both g1 and g2 are above mid-rail, and if so that && expression (the part in parentheses) will return 1 or 0, and so I'm then multiplying by the supply to get a "high" value.

    Your terminology is a bit strange - I don't know what you mean by "skillset in the notepad"!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Charanraj Mohan
    Charanraj Mohan over 8 years ago

    Thanks Andrew. I think I have to add 'if' before (g1>1.65 && g2>1.65)*3.3. Is this right ? Because when I write exactly the same, I get error. How can be the logic used here ? I mean, what is the generic syntax ?

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    No, I don't know why you think that? In spectre if you create the file "forumpwl.pwl" with this content:

    t1 g1
    t2 g2
    t3 (g1>1.65 && g2>1.65)*3.3

    Then forumpwl.scs

    //
    parameters t1=0 g1=3.3 t2=100n g2=2.5 t3=200n

    v1 (n1 0) vsource type=pwl file="forumpwl.pwl"

    tran tran stop=300n

    I changed the values so you could actually see the and in action. This works fine - so not sure what you're doing. You can run from the command line with "spectre forumpwl.scs".

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Charanraj Mohan
    Charanraj Mohan over 8 years ago
    Thanks Andrew.
    I get the following error when I tried in vsource. But in vpwlf it works without the line '(g1>1.65 && g2>1.65)*3.3'. I mean, if I use a value for '(g1>1.65 && g2>1.65)*3.3', it works in vpwlf. But in vsource, it does not.

    Value 0 of parameter 'tvpairs' (Number of pairs of points) out of range [1:50] on instance "V0" in cell-view.

    I think, I am missing something. Can u help me to track it ??

    thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I just realised that you were the person who was asking about PWL sources and it turned out you were using Eldo. 

    So are you using spectre or Eldo in this case? 

    As for the error messages you're showing, you haven't given enough information to know which IC version, which simulator, which simulator version, precisely what you've entered on the forms (pictures help too). As I mentioned in the previous post, Please read the Forum Guidelines. Otherwise, I've just ended up wasting a whole bunch of time giving you answers which are of no use because they're not relevant.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Charanraj Mohan
    Charanraj Mohan over 8 years ago
    Thanks Andrew.
    No, for this experiment I am using Spectre only. I use Eldo only for particular simulations that has a new device/instance that only supports Eldo. Am aware that there is no community support for other simulators. BTW, I figured out the error in my step. I missed couple of settings in vsource. Now it works fine. Thanks.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information