<?xml version="1.0" encoding="utf-8"?>
<circuit>
  <version>1</version>
  <attributes>
    <entry>
      <string>isGeneric</string>
      <boolean>true</boolean>
    </entry>
  </attributes>
  <visualElements>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>en</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="580"/>
    </visualElement>
    <visualElement>
      <elementName>Clock</elementName>
      <elementAttributes>
        <entry>
          <string>runRealTime</string>
          <boolean>true</boolean>
        </entry>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Label</string>
          <string>C</string>
        </entry>
        <entry>
          <string>Frequency</string>
          <int>2</int>
        </entry>
      </elementAttributes>
      <pos x="620" y="260"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>dir</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="280"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>out</string>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="740" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>ovf</string>
        </entry>
      </elementAttributes>
      <pos x="740" y="540"/>
    </visualElement>
    <visualElement>
      <elementName>D_FF</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>*</string>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="640" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="400" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="320" y="120"/>
    </visualElement>
    <visualElement>
      <elementName>Add</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="80" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>Ground</elementName>
      <elementAttributes/>
      <pos x="60" y="220"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="-20" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes/>
      <pos x="360" y="520"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="0" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>-1</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="-20" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Label</string>
          <string>in</string>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="520" y="420"/>
    </visualElement>
    <visualElement>
      <elementName>Comparator</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="240" y="500"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>15</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;
if (orig.maxValue=0) {
    this.Value=(1&lt;&lt;orig.Bits)-1;
} else {
     this.Value=orig.maxValue;
}</string>
        </entry>
      </elementAttributes>
      <pos x="-20" y="500"/>
    </visualElement>
    <visualElement>
      <elementName>Or</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
      </elementAttributes>
      <pos x="400" y="400"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="280" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="260" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes>
        <entry>
          <string>inverterConfig</string>
          <inverterConfig>
            <string>In_2</string>
          </inverterConfig>
        </entry>
      </elementAttributes>
      <pos x="60" y="300"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="560" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Label</string>
          <string>ld</string>
        </entry>
      </elementAttributes>
      <pos x="600" y="420"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>clr</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="440"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>flipSelPos</string>
          <boolean>true</boolean>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="160" y="500"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="140" y="540"/>
    </visualElement>
    <visualElement>
      <elementName>XOr</elementName>
      <elementAttributes/>
      <pos x="-80" y="400"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>generic</string>
          <string>if (orig.inverterConfig.clr) {
    this.Value=1;
}</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="400"/>
    </visualElement>
    <visualElement>
      <elementName>XOr</elementName>
      <elementAttributes/>
      <pos x="-80" y="540"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>generic</string>
          <string>if (orig.inverterConfig.en) {
    this.Value=1;
}</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="540"/>
    </visualElement>
    <visualElement>
      <elementName>XOr</elementName>
      <elementAttributes/>
      <pos x="-80" y="240"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>generic</string>
          <string>if (orig.inverterConfig.dir) {
    this.Value=1;
}</string>
        </entry>
      </elementAttributes>
      <pos x="-100" y="240"/>
    </visualElement>
    <visualElement>
      <elementName>XOr</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
      </elementAttributes>
      <pos x="560" y="400"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>generic</string>
          <string>if (orig.inverterConfig.ld) {
    this.Value=1;
}</string>
        </entry>
      </elementAttributes>
      <pos x="560" y="420"/>
    </visualElement>
    <visualElement>
      <elementName>XOr</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;</string>
        </entry>
      </elementAttributes>
      <pos x="480" y="400"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>generic</string>
          <string>this.Bits=orig.Bits;
if (orig.inverterConfig.in) {
    this.Value=-1;
}</string>
        </entry>
      </elementAttributes>
      <pos x="480" y="420"/>
    </visualElement>
  </visualElements>
  <wires>
    <wire>
      <p1 x="60" y="160"/>
      <p2 x="80" y="160"/>
    </wire>
    <wire>
      <p1 x="-20" y="160"/>
      <p2 x="0" y="160"/>
    </wire>
    <wire>
      <p1 x="140" y="160"/>
      <p2 x="320" y="160"/>
    </wire>
    <wire>
      <p1 x="380" y="160"/>
      <p2 x="400" y="160"/>
    </wire>
    <wire>
      <p1 x="120" y="320"/>
      <p2 x="300" y="320"/>
    </wire>
    <wire>
      <p1 x="-20" y="420"/>
      <p2 x="20" y="420"/>
    </wire>
    <wire>
      <p1 x="20" y="420"/>
      <p2 x="400" y="420"/>
    </wire>
    <wire>
      <p1 x="-20" y="260"/>
      <p2 x="20" y="260"/>
    </wire>
    <wire>
      <p1 x="20" y="260"/>
      <p2 x="180" y="260"/>
    </wire>
    <wire>
      <p1 x="-100" y="580"/>
      <p2 x="-80" y="580"/>
    </wire>
    <wire>
      <p1 x="380" y="200"/>
      <p2 x="400" y="200"/>
    </wire>
    <wire>
      <p1 x="60" y="200"/>
      <p2 x="80" y="200"/>
    </wire>
    <wire>
      <p1 x="-20" y="200"/>
      <p2 x="0" y="200"/>
    </wire>
    <wire>
      <p1 x="260" y="200"/>
      <p2 x="280" y="200"/>
    </wire>
    <wire>
      <p1 x="700" y="200"/>
      <p2 x="720" y="200"/>
    </wire>
    <wire>
      <p1 x="600" y="200"/>
      <p2 x="640" y="200"/>
    </wire>
    <wire>
      <p1 x="720" y="200"/>
      <p2 x="740" y="200"/>
    </wire>
    <wire>
      <p1 x="300" y="520"/>
      <p2 x="360" y="520"/>
    </wire>
    <wire>
      <p1 x="200" y="520"/>
      <p2 x="240" y="520"/>
    </wire>
    <wire>
      <p1 x="20" y="300"/>
      <p2 x="60" y="300"/>
    </wire>
    <wire>
      <p1 x="360" y="140"/>
      <p2 x="380" y="140"/>
    </wire>
    <wire>
      <p1 x="-20" y="560"/>
      <p2 x="340" y="560"/>
    </wire>
    <wire>
      <p1 x="340" y="560"/>
      <p2 x="360" y="560"/>
    </wire>
    <wire>
      <p1 x="60" y="80"/>
      <p2 x="220" y="80"/>
    </wire>
    <wire>
      <p1 x="220" y="80"/>
      <p2 x="720" y="80"/>
    </wire>
    <wire>
      <p1 x="140" y="240"/>
      <p2 x="280" y="240"/>
    </wire>
    <wire>
      <p1 x="-100" y="240"/>
      <p2 x="-80" y="240"/>
    </wire>
    <wire>
      <p1 x="-100" y="400"/>
      <p2 x="-80" y="400"/>
    </wire>
    <wire>
      <p1 x="440" y="180"/>
      <p2 x="560" y="180"/>
    </wire>
    <wire>
      <p1 x="40" y="180"/>
      <p2 x="80" y="180"/>
    </wire>
    <wire>
      <p1 x="-20" y="500"/>
      <p2 x="140" y="500"/>
    </wire>
    <wire>
      <p1 x="220" y="500"/>
      <p2 x="240" y="500"/>
    </wire>
    <wire>
      <p1 x="140" y="500"/>
      <p2 x="160" y="500"/>
    </wire>
    <wire>
      <p1 x="20" y="340"/>
      <p2 x="40" y="340"/>
    </wire>
    <wire>
      <p1 x="-100" y="440"/>
      <p2 x="-80" y="440"/>
    </wire>
    <wire>
      <p1 x="220" y="120"/>
      <p2 x="320" y="120"/>
    </wire>
    <wire>
      <p1 x="-100" y="280"/>
      <p2 x="-80" y="280"/>
    </wire>
    <wire>
      <p1 x="620" y="220"/>
      <p2 x="640" y="220"/>
    </wire>
    <wire>
      <p1 x="500" y="220"/>
      <p2 x="560" y="220"/>
    </wire>
    <wire>
      <p1 x="320" y="220"/>
      <p2 x="380" y="220"/>
    </wire>
    <wire>
      <p1 x="140" y="540"/>
      <p2 x="160" y="540"/>
    </wire>
    <wire>
      <p1 x="420" y="540"/>
      <p2 x="440" y="540"/>
    </wire>
    <wire>
      <p1 x="-100" y="540"/>
      <p2 x="-80" y="540"/>
    </wire>
    <wire>
      <p1 x="440" y="540"/>
      <p2 x="740" y="540"/>
    </wire>
    <wire>
      <p1 x="480" y="400"/>
      <p2 x="480" y="420"/>
    </wire>
    <wire>
      <p1 x="420" y="200"/>
      <p2 x="420" y="340"/>
    </wire>
    <wire>
      <p1 x="580" y="220"/>
      <p2 x="580" y="340"/>
    </wire>
    <wire>
      <p1 x="520" y="400"/>
      <p2 x="520" y="420"/>
    </wire>
    <wire>
      <p1 x="140" y="240"/>
      <p2 x="140" y="500"/>
    </wire>
    <wire>
      <p1 x="620" y="220"/>
      <p2 x="620" y="260"/>
    </wire>
    <wire>
      <p1 x="300" y="240"/>
      <p2 x="300" y="320"/>
    </wire>
    <wire>
      <p1 x="560" y="400"/>
      <p2 x="560" y="420"/>
    </wire>
    <wire>
      <p1 x="720" y="80"/>
      <p2 x="720" y="200"/>
    </wire>
    <wire>
      <p1 x="400" y="400"/>
      <p2 x="400" y="420"/>
    </wire>
    <wire>
      <p1 x="20" y="200"/>
      <p2 x="20" y="260"/>
    </wire>
    <wire>
      <p1 x="20" y="340"/>
      <p2 x="20" y="420"/>
    </wire>
    <wire>
      <p1 x="20" y="260"/>
      <p2 x="20" y="300"/>
    </wire>
    <wire>
      <p1 x="500" y="220"/>
      <p2 x="500" y="340"/>
    </wire>
    <wire>
      <p1 x="340" y="160"/>
      <p2 x="340" y="560"/>
    </wire>
    <wire>
      <p1 x="180" y="260"/>
      <p2 x="180" y="500"/>
    </wire>
    <wire>
      <p1 x="600" y="400"/>
      <p2 x="600" y="420"/>
    </wire>
    <wire>
      <p1 x="440" y="400"/>
      <p2 x="440" y="540"/>
    </wire>
    <wire>
      <p1 x="380" y="200"/>
      <p2 x="380" y="220"/>
    </wire>
    <wire>
      <p1 x="380" y="140"/>
      <p2 x="380" y="160"/>
    </wire>
    <wire>
      <p1 x="60" y="80"/>
      <p2 x="60" y="160"/>
    </wire>
    <wire>
      <p1 x="60" y="200"/>
      <p2 x="60" y="220"/>
    </wire>
    <wire>
      <p1 x="220" y="80"/>
      <p2 x="220" y="120"/>
    </wire>
    <wire>
      <p1 x="220" y="120"/>
      <p2 x="220" y="500"/>
    </wire>
  </wires>
  <measurementOrdering/>
</circuit>