mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-29 07:50:29 -04:00
added a D NAND flip-flop
This commit is contained in:
parent
9db4942e2e
commit
79447f2d2c
184
src/main/dig/sequential/D_NAND.dig
Normal file
184
src/main/dig/sequential/D_NAND.dig
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<circuit>
|
||||||
|
<version>1</version>
|
||||||
|
<attributes/>
|
||||||
|
<visualElements>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>D</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="1240" y="440"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>C</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="1240" y="640"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Q</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="1580" y="480"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>~Q</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="1580" y="600"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Testcase</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Testdata</string>
|
||||||
|
<testData>
|
||||||
|
<dataString>C D Q ~Q
|
||||||
|
C 1 1 0
|
||||||
|
0 1 1 0
|
||||||
|
0 0 1 0
|
||||||
|
C 0 0 1
|
||||||
|
0 0 0 1
|
||||||
|
0 1 0 1
|
||||||
|
</dataString>
|
||||||
|
</testData>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="1520" y="640"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NAnd</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="1440" y="460"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NAnd</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="1440" y="580"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NAnd</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="1300" y="600"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NAnd</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="1300" y="440"/>
|
||||||
|
</visualElement>
|
||||||
|
</visualElements>
|
||||||
|
<wires>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1420" y="560"/>
|
||||||
|
<p2 x="1540" y="520"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1540" y="560"/>
|
||||||
|
<p2 x="1420" y="520"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1400" y="500"/>
|
||||||
|
<p2 x="1280" y="580"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1520" y="480"/>
|
||||||
|
<p2 x="1540" y="480"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1260" y="480"/>
|
||||||
|
<p2 x="1300" y="480"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1540" y="480"/>
|
||||||
|
<p2 x="1580" y="480"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1240" y="640"/>
|
||||||
|
<p2 x="1260" y="640"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1260" y="640"/>
|
||||||
|
<p2 x="1300" y="640"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1420" y="500"/>
|
||||||
|
<p2 x="1440" y="500"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1420" y="580"/>
|
||||||
|
<p2 x="1440" y="580"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1520" y="600"/>
|
||||||
|
<p2 x="1540" y="600"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1280" y="600"/>
|
||||||
|
<p2 x="1300" y="600"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1540" y="600"/>
|
||||||
|
<p2 x="1580" y="600"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1240" y="440"/>
|
||||||
|
<p2 x="1300" y="440"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1380" y="620"/>
|
||||||
|
<p2 x="1440" y="620"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1380" y="460"/>
|
||||||
|
<p2 x="1400" y="460"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1400" y="460"/>
|
||||||
|
<p2 x="1440" y="460"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1280" y="580"/>
|
||||||
|
<p2 x="1280" y="600"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1540" y="480"/>
|
||||||
|
<p2 x="1540" y="520"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1540" y="560"/>
|
||||||
|
<p2 x="1540" y="600"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1400" y="460"/>
|
||||||
|
<p2 x="1400" y="500"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1420" y="560"/>
|
||||||
|
<p2 x="1420" y="580"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1420" y="500"/>
|
||||||
|
<p2 x="1420" y="520"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="1260" y="480"/>
|
||||||
|
<p2 x="1260" y="640"/>
|
||||||
|
</wire>
|
||||||
|
</wires>
|
||||||
|
</circuit>
|
@ -28,8 +28,8 @@ public class TestExamples extends TestCase {
|
|||||||
*/
|
*/
|
||||||
public void testDistExamples() throws Exception {
|
public void testDistExamples() throws Exception {
|
||||||
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig");
|
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig");
|
||||||
assertEquals(190, new FileScanner(this::check).scan(examples));
|
assertEquals(191, new FileScanner(this::check).scan(examples));
|
||||||
assertEquals(89, testCasesInFiles);
|
assertEquals(90, testCasesInFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user