Languages

CommunityCategory: XMODELGenerating a digital pulse alternating between long and short pulsewidths
SA Support Team Staff asked 3 years ago

Is there a way to generate a digital pulse that alternates between long and short pulsewidths as shown below?

1 Answers
Best Answer
SA Support Team Staff answered 3 years ago

Starting with the XMODEL 2022.02 release, the 'pulse_gen' primitive can produce digital pulses with arbitrary waveforms. For instance, its real-typed array parameter 'data' can define the individual transition time instants of a digital pulse waveform. Also, if the waveform repeats a certain pattern, the parameters 'period' and 'repeat_pos' can define its repetition period and starting position. For the complete information on this 'pulse_gen' primitive, please refer to its documentation.

The digital waveform you described can be generated using this 'pulse_gen' instance:

xbit out;
pulse_gen #(.init_value(0), .data('{0.0,1e-9,3e-9,5e-9}), .period(6e-9)) INST (out);

This 'pulse_gen' instance generates a pulse that starts at an initial value of 0 and toggles to a different value at the time instants of 0, 1ns, 3ns, and 5ns. Afterwards, the pulse repeats the same pattern with the period of 6ns. The simulated waveform shown below confirms that the instance generates the desired digital pulse.

SA Support Team Staff asked 3 years ago

아래 그림과 같이 긴 펄스와 짧은 펄스가 교대로 발생하는 디지털 신호를 생성하는 방법이 있을까요?

1 Answers
Best Answer
SA Support Team Staff answered 3 years ago

Starting with the XMODEL 2022.02 release, the 'pulse_gen' primitive can produce digital pulses with arbitrary waveforms. For instance, its real-typed array parameter 'data' can define the individual transition time instants of a digital pulse waveform. Also, if the waveform repeats a certain pattern, the parameters 'period' and 'repeat_pos' can define its repetition period and starting position. For the complete information on this 'pulse_gen' primitive, please refer to its documentation.

The digital waveform you described can be generated using this 'pulse_gen' instance:

xbit out;
pulse_gen #(.init_value(0), .data('{0.0,1e-9,3e-9,5e-9}), .period(6e-9)) INST (out);

This 'pulse_gen' instance generates a pulse that starts at an initial value of 0 and toggles to a different value at the time instants of 0, 1ns, 3ns, and 5ns. Afterwards, the pulse repeats the same pattern with the period of 6ns. The simulated waveform shown below confirms that the instance generates the desired digital pulse.