added a cmos nand

This commit is contained in:
hneemann 2017-06-02 08:41:52 +02:00
parent cf93a019ae
commit 303318a256
2 changed files with 218 additions and 2 deletions

216
src/main/dig/cmos/nand.dig Normal file
View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="utf-8"?>
<circuit>
<version>1</version>
<attributes/>
<visualElements>
<visualElement>
<elementName>VDD</elementName>
<elementAttributes/>
<pos x="220" y="220"/>
</visualElement>
<visualElement>
<elementName>In</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>A</string>
</entry>
</elementAttributes>
<pos x="80" y="300"/>
</visualElement>
<visualElement>
<elementName>Out</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>Y</string>
</entry>
</elementAttributes>
<pos x="320" y="380"/>
</visualElement>
<visualElement>
<elementName>NFET</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>T3</string>
</entry>
</elementAttributes>
<pos x="200" y="400"/>
</visualElement>
<visualElement>
<elementName>PFET</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>T1</string>
</entry>
</elementAttributes>
<pos x="200" y="260"/>
</visualElement>
<visualElement>
<elementName>Ground</elementName>
<elementAttributes/>
<pos x="220" y="540"/>
</visualElement>
<visualElement>
<elementName>Testcase</elementName>
<elementAttributes>
<entry>
<string>Testdata</string>
<testData>
<dataString>A B Y
0 0 1
0 1 1
1 0 1
1 1 0
# transitions
0 0 1
0 1 1
0 0 1
1 0 1
0 0 1
1 1 0
0 0 1
0 1 1
1 0 1
0 1 1
1 1 0
0 1 1
1 0 1
1 1 0
1 0 1
</dataString>
</testData>
</entry>
</elementAttributes>
<pos x="280" y="480"/>
</visualElement>
<visualElement>
<elementName>In</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>B</string>
</entry>
</elementAttributes>
<pos x="80" y="460"/>
</visualElement>
<visualElement>
<elementName>NFET</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>T4</string>
</entry>
</elementAttributes>
<pos x="200" y="460"/>
</visualElement>
<visualElement>
<elementName>PFET</elementName>
<elementAttributes>
<entry>
<string>Label</string>
<string>T2</string>
</entry>
</elementAttributes>
<pos x="240" y="320"/>
</visualElement>
</visualElements>
<wires>
<wire>
<p1 x="140" y="440"/>
<p2 x="180" y="320"/>
</wire>
<wire>
<p1 x="140" y="320"/>
<p2 x="180" y="440"/>
</wire>
<wire>
<p1 x="220" y="240"/>
<p2 x="260" y="240"/>
</wire>
<wire>
<p1 x="180" y="320"/>
<p2 x="240" y="320"/>
</wire>
<wire>
<p1 x="140" y="500"/>
<p2 x="200" y="500"/>
</wire>
<wire>
<p1 x="140" y="260"/>
<p2 x="200" y="260"/>
</wire>
<wire>
<p1 x="180" y="440"/>
<p2 x="200" y="440"/>
</wire>
<wire>
<p1 x="80" y="460"/>
<p2 x="140" y="460"/>
</wire>
<wire>
<p1 x="80" y="300"/>
<p2 x="140" y="300"/>
</wire>
<wire>
<p1 x="220" y="380"/>
<p2 x="260" y="380"/>
</wire>
<wire>
<p1 x="260" y="380"/>
<p2 x="320" y="380"/>
</wire>
<wire>
<p1 x="260" y="240"/>
<p2 x="260" y="320"/>
</wire>
<wire>
<p1 x="260" y="360"/>
<p2 x="260" y="380"/>
</wire>
<wire>
<p1 x="140" y="260"/>
<p2 x="140" y="300"/>
</wire>
<wire>
<p1 x="140" y="440"/>
<p2 x="140" y="460"/>
</wire>
<wire>
<p1 x="140" y="460"/>
<p2 x="140" y="500"/>
</wire>
<wire>
<p1 x="140" y="300"/>
<p2 x="140" y="320"/>
</wire>
<wire>
<p1 x="220" y="220"/>
<p2 x="220" y="240"/>
</wire>
<wire>
<p1 x="220" y="300"/>
<p2 x="220" y="380"/>
</wire>
<wire>
<p1 x="220" y="500"/>
<p2 x="220" y="540"/>
</wire>
<wire>
<p1 x="220" y="440"/>
<p2 x="220" y="460"/>
</wire>
<wire>
<p1 x="220" y="380"/>
<p2 x="220" y="400"/>
</wire>
<wire>
<p1 x="220" y="240"/>
<p2 x="220" y="260"/>
</wire>
</wires>
</circuit>

View File

@ -28,8 +28,8 @@ public class TestExamples extends TestCase {
*/
public void testDistExamples() throws Exception {
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig");
assertEquals(177, new FileScanner(this::check).scan(examples));
assertEquals(78, testCasesInFiles);
assertEquals(178, new FileScanner(this::check).scan(examples));
assertEquals(79, testCasesInFiles);
}
/**