<?xml version="1.0" encoding="UTF-8"?>
<net name="uart_snd" type="iopt-flow">
  <signal id="InData" x="320" y="115" mode="input" type="range" min="0" max="255" frac="0" value="0" dynamic="none" io_pin="0" microstep="0" nano-step="0"/>
  <event id="StartSend" x="190" y="135" mode="input" microstep="0" nano-step="0"/>
  <signal id="TxD" x="715" y="130" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="2" value="1" io_pin="0"/>
  <signal id="ClkDiv" x="100" y="530" mode="input" type="range" min="4" max="65535" frac="0" value="4" dynamic="none" io_pin="0" microstep="0" nano-step="0"/>
  <place id="p6" x="255" y="55" init_marking="1">
    <name off_x="-10" off_y="-10" text="PReady"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t7" x="255" y="135" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TStart"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a8" type="read" source="StartSend" target="t7"/>
  <operation id="o11" x="170" y="465" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="ClkCntr"/>
    <input off_x="-35" off_y="-20" name="Rst" id="o11.Rst" type="event" min="0" max="1" frac="0"/>
    <input off_x="-35" off_y="20" name="ClkDiv" id="o11.ClkDiv" type="range" min="4" max="65535" dynamic="all" frac="0"/>
    <input off_x="-35" off_y="0" name="ClkCntr" id="o11.ClkCntr" type="range" min="0" max="64535" dynamic="name" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o11.out" type="range" min="0" max="65535" dynamic="type" frac="0" microstep="1" nano-step="1">
      <expression>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Rst"/>
          <operator type="or"/>
          <operand type="signal" idRef="ClkCntr" delay="1"/>
          <operator type="more-or-equal"/>
          <operand type="signal" idRef="ClkDiv"/>
        </operand>
        <text>1 WHEN (Rst OR ClkCntr[-1] &gt;= ClkDiv)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="ClkCntr" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <text>ClkCntr[-1] + 1 OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a12" type="read" source="ClkDiv" target="o11.ClkDiv"/>
  <arc id="a14" type="read" source="t7" target="o11.Rst" view="symbolic"/>
  <arc id="a15" type="read" source="o11.out" target="o11.ClkCntr" view="symbolic"/>
  <signal id="Data" x="510" y="145" mode="internal" type="range" min="0" max="255" microstep="1" nano-step="1" frac="0" value="0" dynamic="none"/>
  <operation id="o21" x="420" y="145" rot="0" shape="arrow" size="42">
    <name off_x="-35" off_y="-42" text="o21"/>
    <input off_x="-45" off_y="-30" name="InData" id="o21.InData" type="range" min="0" max="255" dynamic="all" frac="0"/>
    <input off_x="-45" off_y="-10" name="ReadIn" id="o21.ReadIn" type="event" min="0" max="1" frac="0"/>
    <input off_x="-45" off_y="10" name="Data" id="o21.Data" type="range" min="0" max="255" dynamic="all" frac="0"/>
    <input name="Shift" id="o21.Shift" type="event" min="0" max="1" frac="0" off_x="-45" off_y="30"/>
    <output off_x="42" off_y="0" name="out" id="o21.out" type="range" min="0" max="255" dynamic="type" frac="0" microstep="1" nano-step="1">
      <expression>
        <operand type="signal" idRef="InData"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="ReadIn"/>
        </operand>
        <text>InData WHEN (ReadIn)</text>
      </expression>
      <expression>
        <operand type="sub-expression">
          <operand type="signal" idRef="Data" delay="1"/>
          <operator type="div"/>
          <operand type="literal" value="2"/>
        </operand>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Shift"/>
        </operand>
        <text>(Data[-1] / 2) WHEN (Shift)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="Data" delay="1"/>
        <text>Data[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a22" type="read" source="t7" target="o21.ReadIn"/>
  <arc id="a23" type="read" source="InData" target="o21.InData"/>
  <arc id="a24" type="read" source="Data" target="o21.Data" view="symbolic"/>
  <arc id="a25" type="read" source="o21.out" target="Data"/>
  <signal id="Ready" x="325" y="55" mode="output" type="boolean" min="0" max="1" dynamic="type" microstep="0" nano-step="0"/>
  <arc id="a27" type="read" source="p6" target="Ready"/>
  <place id="p28" x="255" y="210" init_marking="0">
    <name off_x="-10" off_y="-10" text="StartBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <arc id="a29" type="normal" source="t7" target="p28"/>
  <transition id="t30" x="255" y="285" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="FirstBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <operation id="o37" x="270" y="520" rot="0" shape="arrow" size="24">
    <name off_x="-19" off_y="-24" text="o37"/>
    <input off_x="-24" off_y="-8" name="ClkCntr" id="o37.ClkCntr" type="range" min="0" max="65535" dynamic="all" frac="0"/>
    <input off_x="-24" off_y="8" name="ClkDiv" id="o37.ClkDiv" type="range" min="4" max="65535" dynamic="all" frac="0"/>
    <output off_x="24" off_y="0" name="out" id="o37.out" type="event" min="0" max="1" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="ClkCntr" delay="1"/>
        <operator type="equal"/>
        <operand type="signal" idRef="ClkDiv"/>
        <text>ClkCntr[-1] = ClkDiv</text>
      </expression>
    </output>
  </operation>
  <arc id="a38" type="read" source="o11.out" target="o37.ClkCntr"/>
  <arc id="a39" type="read" source="ClkDiv" target="o37.ClkDiv"/>
  <place id="p44" x="255" y="360" init_marking="0">
    <name off_x="-10" off_y="-10" text="DataBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t45" x="350" y="360" priority="1" microstep="0">
    <name off_x="-10" off_y="-10" text="SendBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a47" type="normal" source="p44" target="t45" c2_x="-25" c2_y="25" c1_x="0" c1_y="0"/>
  <arc id="a48" type="normal" source="p6" target="t7"/>
  <arc id="a49" type="normal" source="p28" target="t30"/>
  <operation id="o50" x="455" y="300" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o50"/>
    <input off_x="-32" off_y="-16" name="StartSend" id="o50.StartSend" type="event" min="0" max="1" frac="0"/>
    <input off_x="-32" off_y="0" name="SendBit" id="o50.SendBit" type="event" min="0" max="1" frac="0"/>
    <input off_x="-32" off_y="16" name="BitCnt" id="o50.BitCnt" type="range" min="0" max="8" dynamic="all" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o50.out" type="range" min="0" max="8" dynamic="none" frac="0" microstep="1" nano-step="1">
      <expression>
        <operand type="literal" value="0"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="StartSend"/>
        </operand>
        <text>0 WHEN (StartSend)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="BitCnt" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="SendBit"/>
        </operand>
        <text>BitCnt[-1] + 1 WHEN (SendBit)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="BitCnt" delay="1"/>
        <text>BitCnt[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a51" type="read" source="t30" target="o50.StartSend"/>
  <arc id="a52" type="read" source="t45" target="o50.SendBit"/>
  <signal id="BitCnt" x="545" y="300" mode="internal" type="range" min="0" max="8" microstep="1" nano-step="1" frac="0" value="0" dynamic="none"/>
  <arc id="a54" type="read" source="o50.out" target="BitCnt"/>
  <arc id="a55" type="read" source="BitCnt" target="o50.BitCnt" view="symbolic"/>
  <arc id="a56" type="normal" source="t30" target="p44"/>
  <transition id="t57" x="130" y="360" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="LastBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a58" type="normal" source="p44" target="t57"/>
  <arc id="a59" type="normal" source="t45" target="p44" c2_x="25" c2_y="-25" c1_x="0" c1_y="0"/>
  <place id="p60" x="130" y="205" init_marking="0">
    <name off_x="-10" off_y="-10" text="StopBit"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t61" x="130" y="55" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="TSB1"/>
    <comment off_x="0" off_y="20" text="-"/>
  </transition>
  <arc id="a62" type="normal" source="t57" target="p60"/>
  <arc id="a63" type="normal" source="p60" target="t61"/>
  <operation id="o68" x="60" y="360" rot="0" shape="arrow" size="16">
    <name off_x="-11" off_y="-16" text="bit7"/>
    <input off_x="-16" off_y="0" name="BitCnt" id="o68.BitCnt" type="range" min="0" max="8" dynamic="all" frac="0"/>
    <output off_x="16" off_y="0" name="out" id="o68.out" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="BitCnt" delay="1"/>
        <operator type="equal"/>
        <operand type="literal" value="7"/>
        <text>BitCnt[-1] = 7</text>
      </expression>
    </output>
  </operation>
  <arc id="a69" type="read" source="BitCnt" target="o68.BitCnt" view="symbolic"/>
  <arc id="a70" type="read" source="o68.out" target="t57"/>
  <arc id="a71" type="read" source="t45" target="o21.Shift" view="symbolic"/>
  <operation id="o72" x="625" y="130" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o72"/>
    <input off_x="-32" off_y="-16" name="startbit" id="o72.startbit" type="boolean" min="0" max="1" frac="0"/>
    <input off_x="-32" off_y="0" name="databit" id="o72.databit" type="boolean" min="0" max="1" frac="0"/>
    <input off_x="-32" off_y="16" name="data" id="o72.data" type="range" min="0" max="255" frac="0" dynamic="type"/>
    <output off_x="32" off_y="0" name="out" id="o72.out" type="boolean" min="0" max="1" 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="startbit"/>
        </operand>
        <text>0 WHEN (startbit)</text>
      </expression>
      <expression>
        <operand type="sub-expression">
          <operand type="signal" idRef="data"/>
          <operator type="mod"/>
          <operand type="literal" value="2"/>
        </operand>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="databit"/>
        </operand>
        <text>(data MOD 2) WHEN (databit)</text>
      </expression>
      <expression>
        <operand type="literal" value="1"/>
        <text>1 OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a73" type="read" source="p28" target="o72.startbit" view="symbolic"/>
  <arc id="a74" type="read" source="p44" target="o72.databit" view="symbolic"/>
  <arc id="a76" type="read" source="o72.out" target="TxD"/>
  <event id="Baud" x="350" y="520" mode="output" microstep="0" nano-step="1" io_pin="0"/>
  <arc id="a79" type="read" source="o37.out" target="Baud"/>
  <arc id="a80" type="read" source="Baud" target="t57" view="symbolic"/>
  <arc id="a81" type="read" source="Baud" target="t45" view="symbolic"/>
  <arc id="a82" type="read" source="Baud" target="t30" view="symbolic"/>
  <arc id="a4" type="read" source="Baud" target="t61" view="symbolic"/>
  <arc id="a5" type="read" source="Data" target="o72.data"/>
  <arc id="a2" type="normal" source="t61" target="p6"/>
</net>
