J
Jim Thompson
I need to process (in PSpice) a number of the form:
Integer.Decimal
I want to report Decimal when Decimal is <= 0.5
But report -(1-Decimal) when Decimal is > 0.5
(For behavioral modeling of a PLL)
I seem to be foggy-brained this morning and can't sort it out
I have the following functions available:
*
..FUNC FRACT(X) {(ATAN(TAN(((X+1e-11)-0.5)*PI))/PI+0.5)}
..FUNC TRUNC(X) {((X)-FRACT(X))}
..FUNC ROUND(X) {(TRUNC((X)+0.5))}
..FUNC BIT(X,Y) {(SGN(X-(2**Y)+0.1)+1)/2}
..FUNC DIV(X,MOD) {TRUNC((X+1u)/MOD)}
..FUNC MODULO(X,MOD) {(FRACT(X/MOD))*MOD}
..FUNC INT(X) {((X)-FRACT(X))}
..PARAM PI = 3.141593
*
...Jim Thompson
Integer.Decimal
I want to report Decimal when Decimal is <= 0.5
But report -(1-Decimal) when Decimal is > 0.5
(For behavioral modeling of a PLL)
I seem to be foggy-brained this morning and can't sort it out
I have the following functions available:
*
..FUNC FRACT(X) {(ATAN(TAN(((X+1e-11)-0.5)*PI))/PI+0.5)}
..FUNC TRUNC(X) {((X)-FRACT(X))}
..FUNC ROUND(X) {(TRUNC((X)+0.5))}
..FUNC BIT(X,Y) {(SGN(X-(2**Y)+0.1)+1)/2}
..FUNC DIV(X,MOD) {TRUNC((X+1u)/MOD)}
..FUNC MODULO(X,MOD) {(FRACT(X/MOD))*MOD}
..FUNC INT(X) {((X)-FRACT(X))}
..PARAM PI = 3.141593
*
...Jim Thompson