<?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>decimal 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="760" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Add</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="300" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="280" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>Ground</elementName>
      <elementAttributes/>
      <pos x="280" y="240"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>~LD</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>9</string>
        </entry>
        <entry>
          <string>Default</string>
          <int>1</int>
        </entry>
      </elementAttributes>
      <pos x="240" y="300"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="560" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>rotation</string>
          <rotation rotation="1"/>
        </entry>
        <entry>
          <string>Label</string>
          <string>~CLR</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>1</string>
        </entry>
        <entry>
          <string>Default</string>
          <int>1</int>
        </entry>
      </elementAttributes>
      <pos x="700" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>Clock</elementName>
      <elementAttributes>
        <entry>
          <string>runRealTime</string>
          <boolean>true</boolean>
        </entry>
        <entry>
          <string>Label</string>
          <string>CLK</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>2</string>
        </entry>
      </elementAttributes>
      <pos x="240" y="340"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>RCO</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>15</string>
        </entry>
      </elementAttributes>
      <pos x="920" y="440"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes/>
      <pos x="700" y="420"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>ENT</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>10</string>
        </entry>
      </elementAttributes>
      <pos x="240" y="460"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>ENP</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>7</string>
        </entry>
      </elementAttributes>
      <pos x="240" y="380"/>
    </visualElement>
    <visualElement>
      <elementName>And</elementName>
      <elementAttributes/>
      <pos x="280" y="380"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="620" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="680" 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="660" y="120"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>A</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>3</string>
        </entry>
      </elementAttributes>
      <pos x="80" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Comparator</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="400" y="240"/>
    </visualElement>
    <visualElement>
      <elementName>Const</elementName>
      <elementAttributes>
        <entry>
          <string>Value</string>
          <long>9</long>
        </entry>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="380" y="260"/>
    </visualElement>
    <visualElement>
      <elementName>Multiplexer</elementName>
      <elementAttributes>
        <entry>
          <string>Bits</string>
          <int>4</int>
        </entry>
      </elementAttributes>
      <pos x="500" y="180"/>
    </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="480" y="220"/>
    </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="880" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>QA</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>14</string>
        </entry>
      </elementAttributes>
      <pos x="920" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>QB</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>13</string>
        </entry>
      </elementAttributes>
      <pos x="1060" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>QC</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>12</string>
        </entry>
      </elementAttributes>
      <pos x="920" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>Out</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>QD</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>11</string>
        </entry>
      </elementAttributes>
      <pos x="1060" y="200"/>
    </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="220" y="140"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>B</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>4</string>
        </entry>
      </elementAttributes>
      <pos x="200" y="160"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>C</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>5</string>
        </entry>
      </elementAttributes>
      <pos x="80" y="180"/>
    </visualElement>
    <visualElement>
      <elementName>In</elementName>
      <elementAttributes>
        <entry>
          <string>Label</string>
          <string>D</string>
        </entry>
        <entry>
          <string>pinNumber</string>
          <string>6</string>
        </entry>
      </elementAttributes>
      <pos x="200" y="200"/>
    </visualElement>
    <visualElement>
      <elementName>PowerSupply</elementName>
      <elementAttributes/>
      <pos x="280" y="540"/>
    </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="240" y="540"/>
    </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="240" y="580"/>
    </visualElement>
    <visualElement>
      <elementName>Testcase</elementName>
      <elementAttributes>
        <entry>
          <string>Testdata</string>
          <testData>
            <dataString>CLK ~CLR ~LD ENT ENP   D C B A QD QC QB QA

# 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)%10)
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="720" y="580"/>
    </visualElement>
  </visualElements>
  <wires>
    <wire>
      <p1 x="740" y="160"/>
      <p2 x="760" y="160"/>
    </wire>
    <wire>
      <p1 x="660" y="160"/>
      <p2 x="680" y="160"/>
    </wire>
    <wire>
      <p1 x="900" y="160"/>
      <p2 x="1060" y="160"/>
    </wire>
    <wire>
      <p1 x="200" y="160"/>
      <p2 x="220" y="160"/>
    </wire>
    <wire>
      <p1 x="280" y="160"/>
      <p2 x="380" y="160"/>
    </wire>
    <wire>
      <p1 x="380" y="160"/>
      <p2 x="560" y="160"/>
    </wire>
    <wire>
      <p1 x="260" y="420"/>
      <p2 x="280" y="420"/>
    </wire>
    <wire>
      <p1 x="600" y="420"/>
      <p2 x="700" y="420"/>
    </wire>
    <wire>
      <p1 x="280" y="100"/>
      <p2 x="840" y="100"/>
    </wire>
    <wire>
      <p1 x="380" y="260"/>
      <p2 x="400" y="260"/>
    </wire>
    <wire>
      <p1 x="460" y="260"/>
      <p2 x="520" y="260"/>
    </wire>
    <wire>
      <p1 x="520" y="260"/>
      <p2 x="600" y="260"/>
    </wire>
    <wire>
      <p1 x="240" y="580"/>
      <p2 x="260" y="580"/>
    </wire>
    <wire>
      <p1 x="540" y="200"/>
      <p2 x="560" y="200"/>
    </wire>
    <wire>
      <p1 x="280" y="200"/>
      <p2 x="300" y="200"/>
    </wire>
    <wire>
      <p1 x="900" y="200"/>
      <p2 x="1060" y="200"/>
    </wire>
    <wire>
      <p1 x="200" y="200"/>
      <p2 x="220" y="200"/>
    </wire>
    <wire>
      <p1 x="240" y="140"/>
      <p2 x="620" y="140"/>
    </wire>
    <wire>
      <p1 x="80" y="140"/>
      <p2 x="220" y="140"/>
    </wire>
    <wire>
      <p1 x="720" y="140"/>
      <p2 x="760" y="140"/>
    </wire>
    <wire>
      <p1 x="820" y="140"/>
      <p2 x="840" y="140"/>
    </wire>
    <wire>
      <p1 x="900" y="140"/>
      <p2 x="920" y="140"/>
    </wire>
    <wire>
      <p1 x="840" y="140"/>
      <p2 x="880" y="140"/>
    </wire>
    <wire>
      <p1 x="240" y="460"/>
      <p2 x="260" y="460"/>
    </wire>
    <wire>
      <p1 x="260" y="460"/>
      <p2 x="700" y="460"/>
    </wire>
    <wire>
      <p1 x="240" y="300"/>
      <p2 x="640" y="300"/>
    </wire>
    <wire>
      <p1 x="380" y="240"/>
      <p2 x="400" y="240"/>
    </wire>
    <wire>
      <p1 x="340" y="400"/>
      <p2 x="580" y="400"/>
    </wire>
    <wire>
      <p1 x="260" y="560"/>
      <p2 x="280" y="560"/>
    </wire>
    <wire>
      <p1 x="80" y="180"/>
      <p2 x="220" y="180"/>
    </wire>
    <wire>
      <p1 x="360" y="180"/>
      <p2 x="500" y="180"/>
    </wire>
    <wire>
      <p1 x="280" y="180"/>
      <p2 x="300" y="180"/>
    </wire>
    <wire>
      <p1 x="600" y="180"/>
      <p2 x="620" y="180"/>
    </wire>
    <wire>
      <p1 x="900" y="180"/>
      <p2 x="920" y="180"/>
    </wire>
    <wire>
      <p1 x="240" y="340"/>
      <p2 x="740" y="340"/>
    </wire>
    <wire>
      <p1 x="760" y="440"/>
      <p2 x="920" y="440"/>
    </wire>
    <wire>
      <p1 x="660" y="120"/>
      <p2 x="680" y="120"/>
    </wire>
    <wire>
      <p1 x="280" y="220"/>
      <p2 x="300" y="220"/>
    </wire>
    <wire>
      <p1 x="480" y="220"/>
      <p2 x="500" y="220"/>
    </wire>
    <wire>
      <p1 x="240" y="380"/>
      <p2 x="280" y="380"/>
    </wire>
    <wire>
      <p1 x="240" y="540"/>
      <p2 x="280" y="540"/>
    </wire>
    <wire>
      <p1 x="640" y="180"/>
      <p2 x="640" y="300"/>
    </wire>
    <wire>
      <p1 x="580" y="200"/>
      <p2 x="580" y="400"/>
    </wire>
    <wire>
      <p1 x="260" y="420"/>
      <p2 x="260" y="460"/>
    </wire>
    <wire>
      <p1 x="260" y="560"/>
      <p2 x="260" y="580"/>
    </wire>
    <wire>
      <p1 x="740" y="160"/>
      <p2 x="740" y="340"/>
    </wire>
    <wire>
      <p1 x="600" y="260"/>
      <p2 x="600" y="420"/>
    </wire>
    <wire>
      <p1 x="840" y="100"/>
      <p2 x="840" y="140"/>
    </wire>
    <wire>
      <p1 x="280" y="100"/>
      <p2 x="280" y="160"/>
    </wire>
    <wire>
      <p1 x="280" y="220"/>
      <p2 x="280" y="240"/>
    </wire>
    <wire>
      <p1 x="280" y="160"/>
      <p2 x="280" y="180"/>
    </wire>
    <wire>
      <p1 x="520" y="220"/>
      <p2 x="520" y="260"/>
    </wire>
    <wire>
      <p1 x="700" y="160"/>
      <p2 x="700" y="180"/>
    </wire>
    <wire>
      <p1 x="380" y="160"/>
      <p2 x="380" y="240"/>
    </wire>
  </wires>
</circuit>