N
Ned Konz
Guest
I'm trying to use a SPICE model for the MC34063 that I downloaded from
ON Semi
(http://www.onsemi.com/pub/Collateral/MC34063A%20SPICE%20MODEL.ZIP) in
LTSPICE.
I'm running into problems with the syntax of this file.
First, I had to deal with the missing bitwise negation operator (~);
this was easy enough to do.
But then I was stumped by a syntax that I didn't recognize, and I wasn't
able to find any explanation in 5 or 6 different SPICE variants' manuals
that I was able to find on line.
There are a couple of lines in this file that use (what appears to be)
the ternary conditional operator strangely:
B3 9 0 V=(v(6,90) > 3) ? v(diff,90) > 1 ? 0 : v(vdd)
B1 4 90 V=(v(6,90) > 3) ? (v(diff,90) > -1) ? v(vdd) : 0
That is, there are more '?' than ':' characters. I've always used these
in pairs, but then I'm familiar with them from C and other languages.
This syntax is not acceptable to LTSPICE, and I haven't been able to
find any of the many SPICE manuals available on line that actually
discuss variations on the normal
cond ? a : b
syntax.
Could anyone here tell me how to rewrite the above two expressions using
a "normal" syntax for the conditional operator?
As an aside, can anyone think why the author of this file didn't bother
to clarify the meaning of lines like the following by throwing in a few
extra parentheses:
B7 16 90 V=V(vdd,90)-1.5 > 1.25 ? 1.25 : V(vdd,90)-1.25 < 0 ? 0
:V(vdd,90)-1.25
Perhaps they were being charged for each character?
Thanks,
Ned Konz
ON Semi
(http://www.onsemi.com/pub/Collateral/MC34063A%20SPICE%20MODEL.ZIP) in
LTSPICE.
I'm running into problems with the syntax of this file.
First, I had to deal with the missing bitwise negation operator (~);
this was easy enough to do.
But then I was stumped by a syntax that I didn't recognize, and I wasn't
able to find any explanation in 5 or 6 different SPICE variants' manuals
that I was able to find on line.
There are a couple of lines in this file that use (what appears to be)
the ternary conditional operator strangely:
B3 9 0 V=(v(6,90) > 3) ? v(diff,90) > 1 ? 0 : v(vdd)
B1 4 90 V=(v(6,90) > 3) ? (v(diff,90) > -1) ? v(vdd) : 0
That is, there are more '?' than ':' characters. I've always used these
in pairs, but then I'm familiar with them from C and other languages.
This syntax is not acceptable to LTSPICE, and I haven't been able to
find any of the many SPICE manuals available on line that actually
discuss variations on the normal
cond ? a : b
syntax.
Could anyone here tell me how to rewrite the above two expressions using
a "normal" syntax for the conditional operator?
As an aside, can anyone think why the author of this file didn't bother
to clarify the meaning of lines like the following by throwing in a few
extra parentheses:
B7 16 90 V=V(vdd,90)-1.5 > 1.25 ? 1.25 : V(vdd,90)-1.25 < 0 ? 0
:V(vdd,90)-1.25
Perhaps they were being charged for each character?
Thanks,
Ned Konz