|
<< Click to Display Table of Contents >> 5.8 Time Formulas for Clocks and Parameters |
![]() ![]()
|
The information below is a duplicate of the material in section 2.5 of the clocks chapter, but it's repeated here because of it's high importance for specifying timing parameters.
A Time formula can be used wherever a time value is required. For example the min/max for parameters, clock period, clock offset, and clock jitter all can accept time formulas. Time formulas are in display time units (see 1.10 Base and Display Time Units). Some examples of time formulas:
5 + 2 * F0 |
is parsed as 5(time value) + 2(constant) * F0(free parameter) |
D0.max - D1.min |
is parsed as (parameter D0's max value) - (parameter D1's min value) |
Clock0.period / 2 |
is parsed as Clock0.period(Clock0's period value) / 2(constant) |
|
Time formulas are algebraic combinations of the following:
|
D0 D1.min D2.max Clk0.period |
||
|
f(4,5) func.max(2+D0,4) |
||
|
5 2.010 255E-3 |
||
|
'2 '4.1e2 |
||
|
%lib_spec$.F0 |
Dot Attributes
|
F(5).min D0.max |
||
|
Clk.duty Clk.offset Clk.jrise |
Function Definitions in the Parameter Window
|
|
||||
|
FunctionName(input1<,Input2,….,inputN>) |
|
Built in Functions supported:
Function |
Description |
abs |
Returns the absolute value of the number. |
acos |
Returns the arccosine of a number in radians. The number must be a value from –1 to 1. |
asin |
Returns the arcsine of a number in radians. The number must be a value from –1 to 1. |
atan |
Returns the arctangent of a number in radians. |
cos |
Returns the cosine of a number expressed in radians. |
cosh |
Returns the hyperbolic cosine of the number. |
degrees |
Converts radians to degrees. |
exp |
Returns e raised to the power of the number. |
fact |
Returns the factorial of the number. The number must be in the range of 0 to 69. If the number is not an integer, the decimal will be truncated. |
int |
Rounds the number down to the nearest integer. Example: int 4.1 = 4 |
ln |
Returns the natural logarithm (log base e) of the number. The number must be greater than zero. |
log |
Returns the logarithm to the base 10 of the number. The number must be greater than zero. |
radians |
Converts degrees to radians. |
rand |
Returns a random integer between 0 and 32,767 based on the seed number given. |
sign |
Returns -1 if the number is negative, 1 if the number is positive, and zero if the number is zero. |
sin |
Returns the sine of the number expressed in radians. |
sinh |
Returns the hyperbolic sine of the number. |
sqr |
Returns the square root of the number. |
sqrt |
Returns the square root of the number. |
tan |
Returns the tangent of the number expressed in radians. |
tanh |
Returns the hyperbolic tangent of the number. |
trunc |
Truncates the number to an integer by removing the decimal. Example: trunc 4.1 = 4 |
Mathematical Operators
The timing diagram editor supports the +, -, *, and / mathematical operators. The editor also uses the operator ^ to raise a number to a power.
No Circular Dependencies:
Time formulas in parameters can not have circular dependencies. For example, assume A, B, and C are parameters. If A is referenced by B, and B is referenced by C, then C cannot be referenced by A. Each time a parameter is modified, the new value is checked for circular dependencies. When this error is detected, the new data will not be accepted and a message box will appear.