03-03-2009 05:35 PM - edited 03-03-2009 05:40 PM
Hi everyone,
How can I exctract integer from decimal by using ABM and different functions. For exmaple, if I have 15.5, how can I get 15? Pleace advice. Thunks.
Miguel_Schultz
Solved! Go to Solution.
03-06-2009 10:48 AM
Miguel,
Unfortunately the data types and functions/operators that can be used in ABM expressions are not as elaborate as in a programming language. You can't cast values and there are currently no floor/ceiling functions. Take a look at the Mathematical Expression section in the SPICE reference guide in Multisim Help to learn about what can be used within expressions.
One solution is to make a quantizer using the table function. For example,
table(v(1),0,0,0.9999,0,1,1,1.9999,1,2,2)
quantizes the values on v(1) to 0,1,2
You can alternatively use the VOLTAGE_CONTROLLED_PIECEWISE_LINEAR_SOURCE component from Sources/Controlled_Voltage_Sources family. This component does the same job as the table function.
Thanks