Connect with us

Help with PSPICE digital simulation

Discussion in 'CAD' started by Patrick, Mar 13, 2005.

Scroll to continue with content
  1. Patrick

    Patrick Guest

    hello everyone,

    i'm trying to simulate flip-flop circuits using nand gates only
    (cross-coupled nand gates) for a school project with PSPICE. however
    the outputs of my nand gates ( Q and Qnot ) always seem to be at the
    "don't care" (or "X") state after i run the simulation. is this
    because the simulator doesn't know what are the initial states of Q
    and Qnot. is there a way around this? any help is appreciated. thank

    patrick antoun
  2. Jim Thompson

    Jim Thompson Guest

    Digital Setup, Flip-Flop Initialization

    ...Jim Thompson
  3. Patrick

    Patrick Guest

    thanks, will this work (digital setup) even though i'm not actually
    using any flip-flops (my circuit has only cross-coupled nand gates)?
    If so, where do i find this digital setup?
  4. Patrick

    Patrick Guest

    i forgot to mention that i'm using pspice from Orcad version 9.2.3 (Cadence).
    thanks again,
  5. Jim Thompson

    Jim Thompson Guest


    Analysis Setup

    You could also try a .IC=0 (initial condition) on one of the NAND

    ...Jim Thompson
  6. Patrick,
    Take a look at your design. What is setting the state at start-up?
    Your design SHOULD include signal or circuitry to set that initial state
    at the beginning. Even if you have a few digital sources that go from 0
    or 1 to Z (high impedance) just to kick things off...
  7. Jim Thompson

    Jim Thompson Guest



    Am I learning a NEW trick? Can part "DigStim" do that, 0 -> Z? Or
    what part should I use?

    ...Jim Thompson
  8. Wellll.... you could, but that invokes the stimulus editor.

    I would use a stim1 part. That lets you give it a series of commands in
    time state format.
    0s 0
    1us 1
    2us Z

    is one such command sequence. The other stim parts let you have buss
    stimulus defined.
  9. Jim Thompson

    Jim Thompson Guest

    I called it by the wrong name. That will be VERY useful... THANKS!

    ...Jim Thompson
  10. Patrick

    Patrick Guest

    Since i'm new to digital simulation using PSPICE 9.2.X i guess i don't
    have anything that sets the state of the outputs (Q and Qnot) of the
    cross-coupled nand gates. if i was actually writing the netlist i
    would include a .IC or .NODESET command. but since Capture is all GUI
    i don't know how to include this kind of initial condition in my
    i tried connecting a 10k pull-up resistor for the output of one nand
    gate (Q) to VCC. this seemed to sort of work, but it makes the circuit
    analog/digital (by introducing analog components) and the square wave
    at the output of the flip-flop wasn't as nice looking and the clock
    source. there must be a way to accomplish this without having to use a
    pull-up resistor.
    ultimately i'm trying to simulate a clocked JK flip-flop (with preset
    and reset asynchronous inputs) using 2-input and 3-input nand gates.
    this is for a school project. i greatly appreciate and help with this
    problem. thanks again.

  11. Jim Thompson

    Jim Thompson Guest

    Charlie told us how...

    "I would use a stim1 part. That lets you give it a series of commands
    in time state format"

    (Use part named "STIM1")

    0s 0
    1us Z

    Tie to one Q of the cross-coupled NANDs.

    ...Jim Thompson
  12. No Problem!

    Just remember that this uses the standard stim set up in digio.lib, so
    it is typically 0-5v, and goes up to about 2Ghz reliably.

    Also, the Z is what is set up in your digital options, so if you need a
    really high Z (the default IIRC is only 10K) you need to change your
  13. And, depending on your set up, you might need the complement on the
    other one. Remember, if you get an indeterminate signal in your setup,
    it can propogate throughout your circuit...
  14. Jim Thompson

    Jim Thompson Guest

    Hi Charlie,

    Looks like the library is actually named "dig_io.lib" ;-)

    I find "Z" is 1Meg in most logic families, but 200K in TTL.

    I couldn't find "Z" defined in relationship to "STIM1"

    Where is that set?

    ...Jim Thompson
  15. In your sim options, it is called DIGDRVZ, and on my version defaults to 20K

    Usually an advanced digital option.
  16. Jim Thompson

    Jim Thompson Guest

    Is that available readily to those of us still following the true
    faith (AKA MicroSim PSpice Schematics) ?:)

    Aha! Found it right there in the plain vanilla Options settings.

    Is there a way to set Options to always be the values I want, and to
    always appear as the defaults?

    ...Jim Thompson
  17. Charlie

    Charlie Guest

    Hi Jim,
    Not really. You can always create a .inc file with the options set the way
    you want.

    Or wait, can you set them in the pspice.ini file? No, I guess not. In
    Capture, you can now import a standard simulation profile... :cool:

  18. Jim Thompson

    Jim Thompson Guest

    Or get a substitute with a MicroSim-Schematics-like front-end...

    <> ;-)

    But I guess you are right... just do a .INC*

    Any advantage of .INC* versus .LIB*

    ...Jim Thompson
  19. Include files add all the lines into the netlist. A library only adds
    called models, so use includes for setting options and adding 'stuff'!
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day