<?xml version="1.0" encoding="UTF-8"?>
<net name="qe" type="iopt-flow">
  <place id="p1" x="260" y="45" init_marking="0">
    <name off_x="-10" off_y="-10" text="PA0B0"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <place id="p2" x="75" y="230" init_marking="0">
    <name off_x="-10" off_y="-10" text="PA1B0"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <place id="p3" x="260" y="415" init_marking="0">
    <name off_x="-10" off_y="-10" text="PA1B1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <place id="p4" x="440" y="230" init_marking="0">
    <name off_x="-10" off_y="-10" text="PA0B1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t5" x="75" y="45" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TAUp1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t6" x="75" y="415" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TBUp1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t7" x="440" y="415" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TADn1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t8" x="440" y="45" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TBDn1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a9" type="normal" source="p1" target="t5"/>
  <arc id="a10" type="normal" source="t5" target="p2"/>
  <arc id="a11" type="normal" source="p2" target="t6"/>
  <arc id="a12" type="normal" source="t6" target="p3"/>
  <arc id="a13" type="normal" source="p3" target="t7"/>
  <arc id="a14" type="normal" source="t7" target="p4"/>
  <arc id="a15" type="normal" source="p4" target="t8"/>
  <arc id="a16" type="normal" source="t8" target="p1"/>
  <signal id="ChA" x="515" y="45" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="ChB" x="515" y="110" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <event id="Rst" x="515" y="165" mode="input" microstep="0" nano-step="0"/>
  <signal id="Cntr" x="900" y="340" mode="output" type="range" min="0" max="1023" dynamic="none" frac="0" value="0" io_pin="0" microstep="0" nano-step="1"/>
  <place id="p21" x="260" y="230" init_marking="1">
    <name off_x="-10" off_y="-10" text="PInit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t22" x="260" y="120" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TIA0B0"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t23" x="145" y="230" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TIA1B0"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t24" x="260" y="300" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TIA1B1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t25" x="365" y="230" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TIA0B1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a27" type="normal" source="p21" target="t22"/>
  <arc id="a28" type="normal" source="t22" target="p1"/>
  <arc id="a29" type="normal" source="p21" target="t23"/>
  <arc id="a30" type="normal" source="t23" target="p2"/>
  <arc id="a31" type="normal" source="p21" target="t24"/>
  <arc id="a32" type="normal" source="t24" target="p3"/>
  <arc id="a33" type="normal" source="p21" target="t25"/>
  <arc id="a34" type="normal" source="t25" target="p4"/>
  <transition id="t35" x="105" y="80" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TADn2"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t36" x="155" y="360" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TBDn2"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t37" x="405" y="380" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TAUp2"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <transition id="t38" x="405" y="80" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TBUp2"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a39" type="normal" source="p2" target="t35"/>
  <arc id="a40" type="normal" source="t35" target="p1"/>
  <arc id="a41" type="normal" source="p1" target="t38"/>
  <arc id="a42" type="normal" source="t38" target="p4"/>
  <arc id="a43" type="normal" source="p4" target="t37"/>
  <arc id="a44" type="normal" source="t37" target="p3"/>
  <arc id="a45" type="normal" source="p3" target="t36"/>
  <arc id="a46" type="normal" source="t36" target="p2"/>
  <operation id="o2" x="595" y="295" rot="0" shape="arrow" size="40">
    <name off_x="-10" off_y="5" text="CntDn"/>
    <input off_x="-40" off_y="-30" name="t38" id="o2.t38" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="-15" name="t37" id="o2.t37" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="0" name="t36" id="o2.t36" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="15" name="t35" id="o2.t35" type="range" min="-32768" max="32767" dynamic="all"/>
    <input name="X4" id="o2.X4" type="boolean" min="0" max="1" dynamic="all" off_x="-40" off_y="30"/>
    <output off_x="40" off_y="0" name="out" id="o2.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="1">
      <expression>
        <operand type="signal" idRef="t38"/>
        <operator type="or"/>
        <operand type="signal" idRef="t37"/>
        <operator type="or"/>
        <operand type="signal" idRef="t36"/>
        <operator type="or"/>
        <operand type="signal" idRef="t35"/>
        <operator type="when"/>
        <operand type="signal" idRef="X4"/>
        <text>t38 OR t37 OR t36 OR t35 WHEN (X4)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="t38"/>
        <text>t38</text>
      </expression>
    </output>
  </operation>
  <arc id="a3" type="read" source="t38" target="o2.t38" view="symbolic"/>
  <arc id="a4" type="read" source="t37" target="o2.t37" view="symbolic"/>
  <arc id="a5" type="read" source="t36" target="o2.t36" view="symbolic"/>
  <arc id="a6" type="read" source="t35" target="o2.t35" view="symbolic"/>
  <operation id="o7" x="595" y="380" rot="0" shape="arrow" size="40">
    <name off_x="-15" off_y="-10" text="CntUp"/>
    <input off_x="-40" off_y="-30" name="t8" id="o7.t8" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="-15" name="t5" id="o7.t5" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="0" name="t6" id="o7.t6" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="15" name="t7" id="o7.t7" type="range" min="-32768" max="32767" dynamic="all"/>
    <input name="X4" id="o7.X4" type="boolean" min="0" max="1" dynamic="all" off_x="-40" off_y="30"/>
    <output off_x="40" off_y="0" name="out" id="o7.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="1">
      <expression>
        <operand type="signal" idRef="t8"/>
        <operator type="or"/>
        <operand type="signal" idRef="t5"/>
        <operator type="or"/>
        <operand type="signal" idRef="t6"/>
        <operator type="or"/>
        <operand type="signal" idRef="t7"/>
        <operator type="when"/>
        <operand type="signal" idRef="X4"/>
        <text>t8 OR t5 OR t6 OR t7 WHEN (X4)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="t8"/>
        <text>t8 OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a8" type="read" source="t8" target="o7.t8" view="symbolic"/>
  <arc id="a17" type="read" source="t5" target="o7.t5" view="symbolic"/>
  <arc id="a18" type="read" source="t6" target="o7.t6" view="symbolic"/>
  <arc id="a19" type="read" source="t7" target="o7.t7" view="symbolic"/>
  <operation id="o20" x="740" y="340" rot="0" shape="arrow" size="40">
    <name off_x="-20" off_y="-35" text="cntr_upd"/>
    <input off_x="-40" off_y="-24" name="Rst" id="o20.Rst" type="range" min="-32768" max="32767" dynamic="all"/>
    <input off_x="-40" off_y="-8" name="CntDn" id="o20.CntDn" type="boolean" min="0" max="1" dynamic="all" frac="0"/>
    <input off_x="-40" off_y="8" name="CntUp" id="o20.CntUp" type="boolean" min="0" max="1" dynamic="all" frac="0"/>
    <input off_x="-40" off_y="24" name="cntr_upd" id="o20.cntr_upd" type="range" min="0" max="1023" dynamic="all" frac="0"/>
    <output off_x="40" off_y="0" name="out" id="o20.out" type="range" min="0" max="1023" dynamic="none" frac="0" microstep="1" nano-step="2">
      <expression>
        <operand type="literal" value="0"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Rst"/>
        </operand>
        <text>0 WHEN (Rst)</text>
      </expression>
      <expression>
        <operand type="sub-expression">
          <operand type="signal" idRef="cntr_upd" delay="1"/>
          <operator type="add"/>
          <operand type="literal" value="1"/>
        </operand>
        <operator type="mod"/>
        <operand type="literal" value="1024"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="CntUp"/>
        </operand>
        <text>(cntr_upd[-1] + 1) MOD 1024 WHEN (CntUp)</text>
      </expression>
      <expression>
        <operand type="sub-expression">
          <operand type="signal" idRef="cntr_upd" delay="1"/>
          <operator type="add"/>
          <operand type="literal" value="1023"/>
        </operand>
        <operator type="mod"/>
        <operand type="literal" value="1024"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="CntDn"/>
        </operand>
        <text>(cntr_upd[-1] + 1023) MOD 1024 WHEN (CntDn)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="cntr_upd" delay="1"/>
        <text>cntr_upd[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a21" type="read" source="o2.out" target="o20.CntDn"/>
  <arc id="a22" type="read" source="o7.out" target="o20.CntUp"/>
  <arc id="a25" type="read" source="Rst" target="o20.Rst" view="symbolic"/>
  <operation id="o26" x="575" y="45" rot="0" shape="arrow" size="16">
    <name off_x="-10" off_y="-15" text="NotA"/>
    <input off_x="-16" off_y="0" name="ChA" id="o26.ChA" type="boolean" min="0" max="1" dynamic="all"/>
    <output off_x="16" off_y="0" name="out" id="o26.out" type="boolean" min="0" max="1" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChA" neg="true"/>
        <text>NOT(ChA)</text>
      </expression>
    </output>
  </operation>
  <arc id="a35" type="read" source="ChA" target="o26.ChA"/>
  <operation id="o36" x="575" y="110" rot="0" shape="arrow" size="16">
    <name off_x="-10" off_y="-15" text="NotB"/>
    <input off_x="-16" off_y="0" name="ChB" id="o36.ChB" type="boolean" min="0" max="1" dynamic="all"/>
    <output off_x="16" off_y="0" name="out" id="o36.out" type="boolean" min="0" max="1" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChB" neg="true"/>
        <text>NOT(ChB)</text>
      </expression>
    </output>
  </operation>
  <arc id="a37" type="read" source="ChB" target="o36.ChB"/>
  <operation id="o38" x="190" y="120" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="5" text="o38"/>
    <input off_x="-24" off_y="-8" name="ChA" id="o38.ChA" type="boolean" min="0" max="1" dynamic="all"/>
    <input off_x="-24" off_y="8" name="ChB" id="o38.ChB" type="boolean" min="0" max="1" dynamic="all"/>
    <output off_x="24" off_y="0" name="out" id="o38.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChA"/>
        <operator type="equal"/>
        <operand type="literal" value="0"/>
        <operator type="and"/>
        <operand type="signal" idRef="ChB"/>
        <operator type="equal"/>
        <operand type="literal" value="0"/>
        <text>ChA = 0 AND ChB = 0</text>
      </expression>
    </output>
  </operation>
  <arc id="a47" type="read" source="ChA" target="o38.ChA" view="symbolic"/>
  <arc id="a48" type="read" source="ChB" target="o38.ChB" view="symbolic"/>
  <arc id="a49" type="read" source="o38.out" target="t22"/>
  <operation id="o50" x="190" y="300" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="5" text="o38"/>
    <input off_x="-24" off_y="-8" name="ChA" id="o50.ChA" type="boolean" min="0" max="1" dynamic="all"/>
    <input off_x="-24" off_y="8" name="ChB" id="o50.ChB" type="boolean" min="0" max="1" dynamic="type"/>
    <output off_x="24" off_y="0" name="out" id="o50.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChA"/>
        <operator type="equal"/>
        <operand type="literal" value="1"/>
        <operator type="and"/>
        <operand type="signal" idRef="ChB"/>
        <operator type="equal"/>
        <operand type="literal" value="1"/>
        <text>ChA = 1 AND ChB = 1</text>
      </expression>
    </output>
  </operation>
  <arc id="a51" type="read" source="ChA" target="o50.ChA" view="symbolic"/>
  <arc id="a52" type="read" source="ChB" target="o50.ChB" view="symbolic"/>
  <arc id="a53" type="read" source="o50.out" target="t24"/>
  <operation id="o54" x="120" y="175" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="5" text="o38"/>
    <input off_x="-24" off_y="-8" name="ChA" id="o54.ChA" type="boolean" min="0" max="1" dynamic="all"/>
    <input off_x="-24" off_y="8" name="ChB" id="o54.ChB" type="boolean" min="0" max="1" dynamic="all"/>
    <output off_x="24" off_y="0" name="out" id="o54.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChA"/>
        <operator type="equal"/>
        <operand type="literal" value="1"/>
        <operator type="and"/>
        <operand type="signal" idRef="ChB"/>
        <operator type="equal"/>
        <operand type="literal" value="0"/>
        <text>ChA = 1 AND ChB = 0</text>
      </expression>
    </output>
  </operation>
  <arc id="a55" type="read" source="o54.out" target="t23"/>
  <arc id="a56" type="read" source="ChA" target="o54.ChA" view="symbolic"/>
  <arc id="a57" type="read" source="ChB" target="o54.ChB" view="symbolic"/>
  <operation id="o58" x="340" y="285" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="5" text="o38"/>
    <input off_x="-24" off_y="-8" name="ChA" id="o58.ChA" type="boolean" min="0" max="1" dynamic="all"/>
    <input off_x="-24" off_y="8" name="ChB" id="o58.ChB" type="boolean" min="0" max="1" dynamic="all"/>
    <output off_x="24" off_y="0" name="out" id="o58.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ChA"/>
        <operator type="equal"/>
        <operand type="literal" value="0"/>
        <operator type="and"/>
        <operand type="signal" idRef="ChB"/>
        <operator type="equal"/>
        <operand type="literal" value="1"/>
        <text>ChA = 0 AND ChB = 1</text>
      </expression>
    </output>
  </operation>
  <arc id="a59" type="read" source="o58.out" target="t25"/>
  <arc id="a60" type="read" source="ChA" target="o58.ChA" view="symbolic"/>
  <arc id="a61" type="read" source="ChB" target="o58.ChB" view="symbolic"/>
  <arc id="a62" type="read" source="ChA" target="t5" view="symbolic"/>
  <arc id="a63" type="read" source="o26.out" target="t35" view="symbolic"/>
  <arc id="a64" type="read" source="ChB" target="t6" view="symbolic"/>
  <arc id="a66" type="read" source="ChA" target="t37" view="symbolic"/>
  <arc id="a67" type="read" source="o26.out" target="t7" view="symbolic"/>
  <arc id="a68" type="read" source="ChB" target="t38" view="symbolic"/>
  <arc id="a69" type="read" source="o36.out" target="t8" view="symbolic"/>
  <arc id="a1" type="read" source="o36.out" target="t36" view="symbolic"/>
  <signal id="X4" x="515" y="215" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a20" type="read" source="X4" target="o7.X4" view="symbolic"/>
  <arc id="a26" type="read" source="X4" target="o2.X4" view="symbolic"/>
  <operation id="o1" x="840" y="340" rot="0" shape="arrow" size="16">
    <name off_x="-5" off_y="-15" text="Reg"/>
    <input off_x="-16" off_y="0" name="s" id="o1.s" type="range" min="0" max="1023" frac="0" dynamic="type"/>
    <output off_x="16" off_y="0" name="out" id="o1.out" type="range" min="0" max="1023" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="s" delay="1"/>
        <text>s[-1]</text>
      </expression>
    </output>
  </operation>
  <arc id="a2" type="read" source="o20.out" target="o1.s"/>
  <arc id="a7" type="read" source="o1.out" target="Cntr"/>
  <arc id="a24" type="read" source="o20.out" target="o20.cntr_upd" view="symbolic"/>
</net>
