The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 8:36am
Pages: 1
Send Topic Print
event trigger  of integer and real values (Read 1605 times)
sylak
Junior Member
**
Offline



Posts: 24
Silicon valley
event trigger  of integer and real values
Jul 20th, 2007, 3:30pm
 
Suppose I have a

real vout_val;
  integer logic1, logic2;

     logic1 = V(vin1) > vtrans;
     logic2 = V(vin2) > vtrans;

     @ (cross(V(vin1) - vtrans, 1))  logic1 = 1;
     @ (cross(V(vin1) - vtrans, -1)) logic1 = 0;

     @ (cross(V(vin2) - vtrans, 1))  logic2 = 1;
     @ (cross(V(vin2) - vtrans, -1)) logic2 = 0;

     //
     // define the logic function.
     //
     vout_val = (logic1 && logic2) ? vlogic_high : vlogic_low;


if an event happens in vin1 ==> change in logic1?.. will 'vout_val' change along with event based change of logic1 ? or should I include some statement for that to happen?
Back to top
 
 
View Profile   IP Logged
Marq Kole
Senior Member
****
Offline

Hmmm. That's
weird...

Posts: 122
Eindhoven, The Netherlands
Re: event trigger  of integer and real values
Reply #1 - Jul 23rd, 2007, 5:32am
 
Assuming the above code is inside an analog block there is no need to have any additional code with the calculation of vout_val. Any code inside an analog block is evaluated with every time-step unless it is guarded by an event.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.