Boolean pulse

Periodic true pulses.

  • Boolean
  • Modelica Standard Library
  • 1 port
  • 3 parameters
BlockBoolean pulseKindbooleanPulseLibraryLogic

Description

A periodic Boolean pulse train. From startTime on, each period begins with the output true for width percent of the period, then false for the rest. Before startTime the output is false.

Example

Logic gates AND, OR, XOR, NAND, NOR, and NOT on two Boolean pulse trains, and a Boolean turned into a number.

ABANDORXORNANDNORNOT ABoolean to real
In Gradara, select a Boolean pulse block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:ANDORXORNANDNORNOTBoolean to real

Ports

Outputs 1

  • y

    Boolean pulse train.

Parameters

  • Widthwidth50 %

    0 to 100

    Fraction of each period that the output is true, in percent. The underlying MSL source requires it to be greater than 0 and at most 100.

  • Periodperiod0.01 s

    ≥ 0

    Period, in seconds. Must be greater than 0.

  • Start timestartTime0 s

    Time of the first rising edge, in seconds.

Equations

Modelica
At t = startTime + k · period: pulseStart = t
y = pulseStart ≤ t < pulseStart + period · width/100
pulseStart = startTime at the start.

Implementation

Modelica Standard Library 4.1.0Modelica.Blocks.Sources.BooleanPulse
MSL documentation

Assumptions and limitations

  • Edges are instantaneous. Every edge is a simulation event, so a short period over a long run slows the simulation.

Tips

  • For a Real-valued pulse, use Pulse, or convert this output with Boolean to real.

See also

Select a block in Gradara and press F1 to open its page offline.