
- Re: "Algebraic" IF Statement Evaluation
- 05-19-2009
![]() ![]() Re: "Algebraic" IF Statement Evaluation
| Jim Thompson | 05-19-2009 |
![]() ![]() Re: "Algebraic" IF Statement Evaluation
| Spehro Pefhany | 05-19-2009 |
![]() ![]() Re: "Algebraic" IF Statement Evaluation
| Spehro Pefhany | 05-19-2009 |
![]() ![]() Re: "Algebraic" IF Statement Evaluation
| Tom Del Rosso | 05-20-2009 |
If you were Registered and logged in, you could reply and use other advanced thread options
On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
X=int(V11/7)
X/X
On Tue, 19 May 2009 10:53:47 -0600, qrus19@mindspring.com wrote:
This will sorta work, but if x is 0 then you'll probably get errors,
to a human it's the 0/0 = 1 thing not having used your emulator I
can't be sure what'll happen of how to treat an error like this.
On Tue, 19 May 2009 11:03:32 -0600, qrus19@mindspring.com wrote:
I don't have INT available, I do have ABS and some trig functions
...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
Stormy on the East Coast today... due to Bush's failed policies.
On Tue, 19 May 2009 10:06:34 -0700, Jim Thompson
y = V11 -7
(abs(y) + y)/(2*y)
On Tue, 19 May 2009 14:03:08 -0400, Spehro Pefhany
P.S. If you want avoid awkward situations very near y == 0 you could
do
(abs(y) + y)/(2* abs(y) + e)
where e is a very small positive number
X=int(V11/7)
X/X
On Tue, 19 May 2009 10:53:47 -0600, qrus19@mindspring.com wrote:
>On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
>>I need to evaluate...
>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>t may be something like V11 >= 7, for example)
>>BUT I have no IF statement handling capability at this level of a
>>simulation.
>>I do have algebraic capability.
>>Is there some cute way to do this algebraically?
>> ...Jim Thompson
>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>t may be something like V11 >= 7, for example)
>>BUT I have no IF statement handling capability at this level of a
>>simulation.
>>I do have algebraic capability.
>>Is there some cute way to do this algebraically?
>> ...Jim Thompson
>X=int(V11/7)
>X/X
t=X/X
>X/X
This will sorta work, but if x is 0 then you'll probably get errors,
to a human it's the 0/0 = 1 thing not having used your emulator I
can't be sure what'll happen of how to treat an error like this.
On Tue, 19 May 2009 11:03:32 -0600, qrus19@mindspring.com wrote:
>On Tue, 19 May 2009 10:53:47 -0600, qrus19@mindspring.com wrote:
>>On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
>>>I need to evaluate...
>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>t may be something like V11 >= 7, for example)
>>>BUT I have no IF statement handling capability at this level of a
>>>simulation.
>>>I do have algebraic capability.
>>>Is there some cute way to do this algebraically?
>>> ...Jim Thompson
>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>t may be something like V11 >= 7, for example)
>>>BUT I have no IF statement handling capability at this level of a
>>>simulation.
>>>I do have algebraic capability.
>>>Is there some cute way to do this algebraically?
>>> ...Jim Thompson
>>X=int(V11/7)
>>X/X
>>X/X
>t=X/X
>This will sorta work, but if x is 0 then you'll probably get errors,
>to a human it's the 0/0 = 1 thing not having used your emulator I
>can't be sure what'll happen of how to treat an error like this.
>
>This will sorta work, but if x is 0 then you'll probably get errors,
>to a human it's the 0/0 = 1 thing not having used your emulator I
>can't be sure what'll happen of how to treat an error like this.
>
I don't have INT available, I do have ABS and some trig functions
...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
Stormy on the East Coast today... due to Bush's failed policies.
On Tue, 19 May 2009 10:06:34 -0700, Jim Thompson
>On Tue, 19 May 2009 11:03:32 -0600, qrus19@mindspring.com wrote:
>>On Tue, 19 May 2009 10:53:47 -0600, qrus19@mindspring.com wrote:
>>>On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
>>>>I need to evaluate...
>>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>>t may be something like V11 >= 7, for example)
>>>>BUT I have no IF statement handling capability at this level of a
>>>>simulation.
>>>>I do have algebraic capability.
>>>>Is there some cute way to do this algebraically?
>>>> ...Jim Thompson
>>>X=int(V11/7)
>>>X/X
>>>>I need to evaluate...
>>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>>t may be something like V11 >= 7, for example)
>>>>BUT I have no IF statement handling capability at this level of a
>>>>simulation.
>>>>I do have algebraic capability.
>>>>Is there some cute way to do this algebraically?
>>>> ...Jim Thompson
>>>X=int(V11/7)
>>>X/X
>>t=X/X
>>This will sorta work, but if x is 0 then you'll probably get errors,
>>to a human it's the 0/0 = 1 thing not having used your emulator I
>>can't be sure what'll happen of how to treat an error like this.
>>
>>This will sorta work, but if x is 0 then you'll probably get errors,
>>to a human it's the 0/0 = 1 thing not having used your emulator I
>>can't be sure what'll happen of how to treat an error like this.
>>
>I don't have INT available, I do have ABS and some trig functions
> ...Jim Thompson
> ...Jim Thompson
y = V11 -7
(abs(y) + y)/(2*y)
On Tue, 19 May 2009 14:03:08 -0400, Spehro Pefhany
>On Tue, 19 May 2009 10:06:34 -0700, Jim Thompson
>>On Tue, 19 May 2009 11:03:32 -0600, qrus19@mindspring.com wrote:
>>>On Tue, 19 May 2009 10:53:47 -0600, qrus19@mindspring.com wrote:
>>>>On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
>>>>>I need to evaluate...
>>>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>>>t may be something like V11 >= 7, for example)
>>>>>BUT I have no IF statement handling capability at this level of a
>>>>>simulation.
>>>>>I do have algebraic capability.
>>>>>Is there some cute way to do this algebraically?
>>>>> ...Jim Thompson
>>>>X=int(V11/7)
>>>>X/X
>>>t=X/X
>>>This will sorta work, but if x is 0 then you'll probably get errors,
>>>to a human it's the 0/0 = 1 thing not having used your emulator I
>>>can't be sure what'll happen of how to treat an error like this.
>>>
>>>>On Tue, 19 May 2009 09:19:33 -0700, Jim Thompson
>>>>>I need to evaluate...
>>>>>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>>>>>t may be something like V11 >= 7, for example)
>>>>>BUT I have no IF statement handling capability at this level of a
>>>>>simulation.
>>>>>I do have algebraic capability.
>>>>>Is there some cute way to do this algebraically?
>>>>> ...Jim Thompson
>>>>X=int(V11/7)
>>>>X/X
>>>t=X/X
>>>This will sorta work, but if x is 0 then you'll probably get errors,
>>>to a human it's the 0/0 = 1 thing not having used your emulator I
>>>can't be sure what'll happen of how to treat an error like this.
>>>
>>I don't have INT available, I do have ABS and some trig functions
>> ...Jim Thompson
>> ...Jim Thompson
>y = V11 -7
>(abs(y) + y)/(2*y)
>(abs(y) + y)/(2*y)
P.S. If you want avoid awkward situations very near y == 0 you could
do
(abs(y) + y)/(2* abs(y) + e)
where e is a very small positive number
- Re: "Algebraic" IF Statement Evaluation
- May 20, 2009, 7:38 am
- Re: "Algebraic" IF Statement Evaluation
- May 19, 2009, 1:43 pm
- Re: "Algebraic" IF Statement Evaluation
- May 19, 2009, 1:49 pm
- Re: "Algebraic" IF Statement Evaluation
- May 19, 2009, 12:56 pm
- Re: "Algebraic" IF Statement Evaluation
- May 19, 2009, 12:56 pm
- "Algebraic" IF Statement Evaluation
- May 19, 2009, 12:19 pm






>IF(t,1,0) (If t is true, output 1, if t is false, output 0 (numeric),
>t may be something like V11 >= 7, for example)
>BUT I have no IF statement handling capability at this level of a
>simulation.
>I do have algebraic capability.
>Is there some cute way to do this algebraically?
> ...Jim Thompson