Maker Pro
Maker Pro

"Logic" Problem - A More Difficult Variation

J

Jim Thompson

PSpice Simulation Problem (A More Difficult Variation):

I have a (decimal) parameter (P) that varies from 1 thru 18 in steps
of 1.

With only IF-THEN-ELSE, AND (&), OR (|), Algebraic and MODULO operator
capabilities, how do I most compactly separate the following events:

P = 1 or 2 or 3

P = 4 or 5 or 6

P = 7 or 8 or 9

P = 10 or 11 or 12

P = 13 or 14 or 15

P = 16 or 17 or 18

Thanks!

(In case anyone is curious, I'm trying to build a multi-variable
stepping capability into PSpice's restriction of one .STEP statement.
I have a lot of Process/Voltage/Temperature simulations to do for a
design review and I'm trying to minimize the amount of hand-editing.)

...Jim Thompson
 
R

Rene Tschaggelar

Jim said:
PSpice Simulation Problem (A More Difficult Variation):

I have a (decimal) parameter (P) that varies from 1 thru 18 in steps
of 1.

With only IF-THEN-ELSE, AND (&), OR (|), Algebraic and MODULO operator
capabilities, how do I most compactly separate the following events:

P = 1 or 2 or 3

P = 4 or 5 or 6

P = 7 or 8 or 9

P = 10 or 11 or 12

P = 13 or 14 or 15

P = 16 or 17 or 18

Thanks!

(In case anyone is curious, I'm trying to build a multi-variable
stepping capability into PSpice's restriction of one .STEP statement.
I have a lot of Process/Voltage/Temperature simulations to do for a
design review and I'm trying to minimize the amount of hand-editing.)

...Jim Thompson

This is simpler

(P-1) div 3

If 'div' is not available : repeated subtraction.


Rene
 
N

Nico Coesel

Jim Thompson said:
PSpice Simulation Problem (A More Difficult Variation):

I have a (decimal) parameter (P) that varies from 1 thru 18 in steps
of 1.

With only IF-THEN-ELSE, AND (&), OR (|), Algebraic and MODULO operator
capabilities, how do I most compactly separate the following events:

P = 1 or 2 or 3

P = 4 or 5 or 6

P = 7 or 8 or 9

P = 10 or 11 or 12

P = 13 or 14 or 15

P = 16 or 17 or 18

Thanks!

(In case anyone is curious, I'm trying to build a multi-variable
stepping capability into PSpice's restriction of one .STEP statement.
I have a lot of Process/Voltage/Temperature simulations to do for a
design review and I'm trying to minimize the amount of hand-editing.)

Wouldn't it be easier to run Pspice from the command line and have a
'script' (written in something like basic, PHP, Perl, etc, etc) modify
the input file, run spice, append the output to an PSpice output file
and repeat the entire process until you have collected the information
you need?
 
J

Jim Thompson

Wouldn't it be easier to run Pspice from the command line and have a
'script' (written in something like basic, PHP, Perl, etc, etc) modify
the input file, run spice, append the output to an PSpice output file
and repeat the entire process until you have collected the information
you need?

That's what I do now, but it's a pain.

(And customers buy beautiful presentations, not raw data ;-)

...Jim Thompson
 
J

Jim Thompson

[snip]
This is simpler

(P-1) div 3

If 'div' is not available : repeated subtraction.


Rene

OK, got it. I was able, observing my son's other scripts, to quickly
write one for DIV.

Shades of "Elementary Number Theory", haven't done much of this stuff
for 44 years ;-)

...Jim Thompson
 
Top