Languages

CommunityCategory: XMODELGenerating a signal that increases in a step-wise fashion

XMODEL

Generating a signal that increases in a step-wise fashion

SA Support Team Staff 2018-11-30

Can I generate a signal that increases in a step-wise fashion at a fixed interval using the XMODEL primitives?

1 Answers
Best Answer
SA Support Team Staff 2018-11-30

Perhaps the difficulty lies in the fact that the signal to be generated is not periodic by itself. There are multiple ways to generate the desired signal using the XMODEL primitives.

1. Using the integ primitive

You can create a periodic chain of pulses first using a pwl_gen primitive and then integrate it using an integ primitive to produce a signal that increases in a step-wise fashion. In this case, the area of each pulse and gain of the integ primitive determine the amount of each step change, while the width of each pulse determines the transition time, and the init_value parameter of the integ primitive sets the initial output value.

For example, the following model generates a signal that increases by 10mV at 200ns interval.




2. Using the sample primitive

Another way is to use a sample primitive. For instance, the model shown below uses an add primitive to compute the next output value based on the current output value, and uses a sample primitive to determine when the output is updated by that next value. Hence, the input to the add primitive determines the amount of step change, and the trigger period for the sample primitive determines the step period. The buffer primitive is for setting the initial output value using its init_value parameter. The model shown below generates a signal that increases by 10mV at 200ns interval.