<?xml version="1.0" encoding="utf-8"?>
<circuit>
  <version>1</version>
  <attributes>
    <entry>
      <string>shapeType</string>
      <shapeType>DIL</shapeType>
    </entry>
    <entry>
      <string>Description</string>
      <string>hex synchronous counter</string>
    </entry>
    <entry>
      <string>lockedMode</string>
      <boolean>true</boolean>
    </entry>
    <entry>
      <string>Width</string>
      <int>5</int>
    </entry>
  </attributes>
  <visualElements>
    <visualElement>
      <elementName>D_FF</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>Q</string>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="660" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Add</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="380" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="360" y="220"/>
    </visualElement>
    <visualElement>
      <elementName>Ground</elementName>
      <elementAttributes/>
      <pos x="360" y="260"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>~PE</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>9</string>
        </entry>
        <entry>
          <string>Default</string>
          <int>1</int>
        </entry>
      </elementAttributes>
      <pos x="320" y="300"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="460" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Label</string>
          <string>~SR</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>1</string>
        </entry>
        <entry>
          <string>Default</string>
          <int>1</int>
        </entry>
      </elementAttributes>
      <pos x="600" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>Clock</elementName>
      <elementAttributes>
        <entry>
          <string>runRealTime</string>
          <boolean>true</boolean>
        </entry>
        <entry>
          <string>Label</string>
          <string>CP</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>2</string>
        </entry>
      </elementAttributes>
      <pos x="320" y="340"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>TC</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>15</string>
        </entry>
      </elementAttributes>
      <pos x="760" y="440"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes/>
      <pos x="600" y="420"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>CET</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>10</string>
        </entry>
      </elementAttributes>
      <pos x="320" y="460"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>CEP</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>7</string>
        </entry>
      </elementAttributes>
      <pos x="320" y="380"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes/>
      <pos x="360" y="380"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="520" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="580" y="120"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>0</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="560" y="120"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>P0</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>3</string>
        </entry>
      </elementAttributes>
      <pos x="160" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Splitter</elementName>
      <elementAttributes>
        <entry>
          <string>Input Splitting</string>
          <string>1*4</string>
        </entry>
        <entry>
          <string>Output Splitting</string>
          <string>4</string>
        </entry>
      </elementAttributes>
      <pos x="300" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>P1</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>4</string>
        </entry>
      </elementAttributes>
      <pos x="280" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>P2</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>5</string>
        </entry>
      </elementAttributes>
      <pos x="160" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>P3</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>6</string>
        </entry>
      </elementAttributes>
      <pos x="280" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Splitter</elementName>
      <elementAttributes>
        <entry>
          <string>Input Splitting</string>
          <string>4</string>
        </entry>
        <entry>
          <string>Output Splitting</string>
          <string>1*4</string>
        </entry>
      </elementAttributes>
      <pos x="760" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>Q0</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>14</string>
        </entry>
      </elementAttributes>
      <pos x="800" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>Q1</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>13</string>
        </entry>
      </elementAttributes>
      <pos x="940" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>Q2</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>12</string>
        </entry>
      </elementAttributes>
      <pos x="800" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>Q3</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>11</string>
        </entry>
      </elementAttributes>
      <pos x="940" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Testcase</elementName>
      <elementAttributes>
        <entry>
          <string>Testdata</string>
          <testData>
            <dataString>CP ~SR ~PE CET CEP   P3 P2 P1 P0 Q3 Q2 Q1 Q0

# load
loop(i,4)
loop(n,16)
C  1   0   bits(2,i) bits(4,n)   bits(4,n)
end loop
end loop

# reset
loop(i,8)
loop(n,16)
C  1   0   0   0     bits(4,n)   bits(4,n)
C  0   bits(3,i)     bits(4,n)   bits(4,0)
end loop
end loop

# count
loop(n,16)
C  1   1   1   1     bits(4,0)   bits(4,n+1)
end loop

# hold
loop(n,16)
C  1   0   0   0     bits(4,n)   bits(4,n)
C  1   1   0   0     bits(4,n)   bits(4,n)
C  1   1   1   0     bits(4,n)   bits(4,n)
C  1   1   0   1     bits(4,n)   bits(4,n)
end loop
</dataString>
          </testData>
        </entry>
      </elementAttributes>
      <pos x="840" y="300"/>
    </visualElement>
    <visualElement>
      <elementName>PowerSupply</elementName>
      <elementAttributes/>
      <pos x="360" y="20"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>VCC</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>16</string>
        </entry>
        <entry>
          <string>InDefault</string>
          <value v="1" z="false"/>
        </entry>
      </elementAttributes>
      <pos x="320" y="20"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>GND</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>8</string>
        </entry>
      </elementAttributes>
      <pos x="320" y="60"/>
    </visualElement>
  </visualElements>
  <wires>
    <wire>
      <p1 x="640" y="160"/>
      <p2 x="660" y="160"/>
    </wire>
    <wire>
      <p1 x="560" y="160"/>
      <p2 x="580" y="160"/>
    </wire>
    <wire>
      <p1 x="780" y="160"/>
      <p2 x="940" y="160"/>
    </wire>
    <wire>
      <p1 x="280" y="160"/>
      <p2 x="300" y="160"/>
    </wire>
    <wire>
      <p1 x="360" y="160"/>
      <p2 x="460" y="160"/>
    </wire>
    <wire>
      <p1 x="460" y="420"/>
      <p2 x="600" y="420"/>
    </wire>
    <wire>
      <p1 x="340" y="420"/>
      <p2 x="360" y="420"/>
    </wire>
    <wire>
      <p1 x="360" y="100"/>
      <p2 x="740" y="100"/>
    </wire>
    <wire>
      <p1 x="360" y="200"/>
      <p2 x="380" y="200"/>
    </wire>
    <wire>
      <p1 x="440" y="200"/>
      <p2 x="460" y="200"/>
    </wire>
    <wire>
      <p1 x="780" y="200"/>
      <p2 x="940" y="200"/>
    </wire>
    <wire>
      <p1 x="280" y="200"/>
      <p2 x="300" y="200"/>
    </wire>
    <wire>
      <p1 x="340" y="40"/>
      <p2 x="360" y="40"/>
    </wire>
    <wire>
      <p1 x="320" y="140"/>
      <p2 x="520" y="140"/>
    </wire>
    <wire>
      <p1 x="160" y="140"/>
      <p2 x="300" y="140"/>
    </wire>
    <wire>
      <p1 x="620" y="140"/>
      <p2 x="660" y="140"/>
    </wire>
    <wire>
      <p1 x="720" y="140"/>
      <p2 x="740" y="140"/>
    </wire>
    <wire>
      <p1 x="780" y="140"/>
      <p2 x="800" y="140"/>
    </wire>
    <wire>
      <p1 x="740" y="140"/>
      <p2 x="760" y="140"/>
    </wire>
    <wire>
      <p1 x="320" y="460"/>
      <p2 x="340" y="460"/>
    </wire>
    <wire>
      <p1 x="340" y="460"/>
      <p2 x="600" y="460"/>
    </wire>
    <wire>
      <p1 x="320" y="300"/>
      <p2 x="540" y="300"/>
    </wire>
    <wire>
      <p1 x="360" y="240"/>
      <p2 x="380" y="240"/>
    </wire>
    <wire>
      <p1 x="420" y="400"/>
      <p2 x="480" y="400"/>
    </wire>
    <wire>
      <p1 x="160" y="180"/>
      <p2 x="300" y="180"/>
    </wire>
    <wire>
      <p1 x="500" y="180"/>
      <p2 x="520" y="180"/>
    </wire>
    <wire>
      <p1 x="780" y="180"/>
      <p2 x="800" y="180"/>
    </wire>
    <wire>
      <p1 x="320" y="340"/>
      <p2 x="640" y="340"/>
    </wire>
    <wire>
      <p1 x="320" y="20"/>
      <p2 x="360" y="20"/>
    </wire>
    <wire>
      <p1 x="660" y="440"/>
      <p2 x="760" y="440"/>
    </wire>
    <wire>
      <p1 x="560" y="120"/>
      <p2 x="580" y="120"/>
    </wire>
    <wire>
      <p1 x="360" y="220"/>
      <p2 x="380" y="220"/>
    </wire>
    <wire>
      <p1 x="440" y="220"/>
      <p2 x="460" y="220"/>
    </wire>
    <wire>
      <p1 x="320" y="380"/>
      <p2 x="360" y="380"/>
    </wire>
    <wire>
      <p1 x="320" y="60"/>
      <p2 x="340" y="60"/>
    </wire>
    <wire>
      <p1 x="640" y="160"/>
      <p2 x="640" y="340"/>
    </wire>
    <wire>
      <p1 x="480" y="200"/>
      <p2 x="480" y="400"/>
    </wire>
    <wire>
      <p1 x="340" y="420"/>
      <p2 x="340" y="460"/>
    </wire>
    <wire>
      <p1 x="340" y="40"/>
      <p2 x="340" y="60"/>
    </wire>
    <wire>
      <p1 x="740" y="100"/>
      <p2 x="740" y="140"/>
    </wire>
    <wire>
      <p1 x="600" y="160"/>
      <p2 x="600" y="180"/>
    </wire>
    <wire>
      <p1 x="360" y="100"/>
      <p2 x="360" y="160"/>
    </wire>
    <wire>
      <p1 x="360" y="240"/>
      <p2 x="360" y="260"/>
    </wire>
    <wire>
      <p1 x="360" y="160"/>
      <p2 x="360" y="200"/>
    </wire>
    <wire>
      <p1 x="540" y="180"/>
      <p2 x="540" y="300"/>
    </wire>
    <wire>
      <p1 x="460" y="220"/>
      <p2 x="460" y="420"/>
    </wire>
  </wires>
</circuit>