<?xml version="1.0" encoding="UTF-8"?>
<net name="tOnOff" type="iopt-flow">
  <signal id="in" x="240" y="290" mode="input" type="boolean" min="0" max="1"/>
  <signal id="delay" x="290" y="310" mode="input" type="range" min="0" max="32767" frac="0" value="0" dynamic="none"/>
  <signal id="out" x="605" y="290" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0"/>
  <operation id="o1" x="435" y="320" rot="0" shape="rect" size="64">
    <name off_x="-58" off_y="-51" text="chg_delay"/>
    <input off_x="-65" off_y="-30" name="in" id="o1.in" type="boolean" min="0" max="1" frac="0"/>
    <input off_x="-65" off_y="-10" name="delay" id="o1.delay" type="range" min="0" max="32767" frac="0"/>
    <input name="in_cntr" id="o1.in_cntr" type="range" min="0" max="32767" frac="0" off_x="-65" off_y="30"/>
    <input name="out_fb" id="o1.out_fb" type="boolean" min="0" max="1" frac="0" dynamic="type" off_x="-65" off_y="10"/>
    <output off_x="65" off_y="-30" name="out" id="o1.out" type="boolean" min="0" max="1" frac="0">
      <expression>
        <operand type="signal" idRef="in"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="in_cntr"/>
          <operator type="more-or-equal"/>
          <operand type="signal" idRef="delay"/>
        </operand>
        <text>in WHEN (in_cntr &gt;= delay)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="out_fb" delay="1"/>
        <text>out_fb[-1] OTHERWISE</text>
      </expression>
    </output>
    <output name="cntr" id="o1.cntr" type="range" min="0" max="32767" frac="0" off_x="65" off_y="30">
      <expression>
        <operand type="literal" value="0"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="in"/>
          <operator type="diff"/>
          <operand type="signal" idRef="in" delay="1"/>
        </operand>
        <text>0 WHEN (in &lt;&gt; in[-1])</text>
      </expression>
      <expression>
        <operand type="signal" idRef="in_cntr" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="in_cntr" delay="1"/>
          <operator type="less"/>
          <operand type="signal" idRef="delay"/>
        </operand>
        <text>in_cntr[-1] + 1 WHEN (in_cntr[-1] &lt; delay)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="delay"/>
        <text>delay</text>
      </expression>
    </output>
  </operation>
  <arc id="a7" type="read" source="in" target="o1.in"/>
  <arc id="a8" type="read" source="delay" target="o1.delay"/>
  <arc id="a9" type="read" source="o1.out" target="out"/>
  <arc id="a10" type="read" source="o1.cntr" target="o1.in_cntr" view="symbolic"/>
  <arc id="a1" type="read" source="o1.out" target="o1.out_fb" view="symbolic"/>
</net>
