J
Jim Thompson
Guest
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
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice480)460-2350 | |
| E-mail Address at Website Fax480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
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
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice480)460-2350 | |
| E-mail Address at Website Fax480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.