mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-27 06:51:37 -04:00
added nmos xor example
This commit is contained in:
parent
79330a2128
commit
32da3e7d9b
@ -82,6 +82,13 @@
|
|||||||
<include>*.dig</include>
|
<include>*.dig</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/src/main/dig/nmos</directory>
|
||||||
|
<outputDirectory>/examples/nmos/</outputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>*.dig</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>${basedir}/src/main/dig/test</directory>
|
<directory>${basedir}/src/main/dig/test</directory>
|
||||||
<outputDirectory>/examples/test/</outputDirectory>
|
<outputDirectory>/examples/test/</outputDirectory>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Release Notes
|
Release Notes
|
||||||
|
|
||||||
planned as v0.13
|
HEAD, planned as v0.13
|
||||||
- Added a barrel shifter (thanks to roy77)
|
- Added a barrel shifter (thanks to roy77)
|
||||||
- In case of oscillations almost all affected components are shown.
|
- In case of oscillations almost all affected components are shown.
|
||||||
- If an error occurs, the name of the affected circuit file is shown.
|
- If an error occurs, the name of the affected circuit file is shown.
|
||||||
|
137
src/main/dig/nmos/xnor.dig
Normal file
137
src/main/dig/nmos/xnor.dig
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<circuit>
|
||||||
|
<version>1</version>
|
||||||
|
<attributes/>
|
||||||
|
<visualElements>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>A</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="220" y="160"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>B</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="220" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NFET</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="260" y="120"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NFET</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="300" y="160"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>PullUp</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="320" y="100"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Y</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="360" y="120"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Testcase</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Testdata</string>
|
||||||
|
<testData>
|
||||||
|
<dataString>A B Y
|
||||||
|
0 0 1
|
||||||
|
0 1 0
|
||||||
|
1 0 0
|
||||||
|
1 1 1
|
||||||
|
|
||||||
|
|
||||||
|
# transitions
|
||||||
|
0 0 1
|
||||||
|
0 1 0
|
||||||
|
0 0 1
|
||||||
|
1 0 0
|
||||||
|
0 0 1
|
||||||
|
1 1 1
|
||||||
|
0 0 1
|
||||||
|
0 1 0
|
||||||
|
1 0 0
|
||||||
|
0 1 0
|
||||||
|
1 1 1
|
||||||
|
0 1 0
|
||||||
|
1 0 0
|
||||||
|
1 1 1
|
||||||
|
1 0 0
|
||||||
|
</dataString>
|
||||||
|
</testData>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="160" y="40"/>
|
||||||
|
</visualElement>
|
||||||
|
</visualElements>
|
||||||
|
<wires>
|
||||||
|
<wire>
|
||||||
|
<p1 x="220" y="160"/>
|
||||||
|
<p2 x="240" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="160"/>
|
||||||
|
<p2 x="260" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="220" y="200"/>
|
||||||
|
<p2 x="280" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="200"/>
|
||||||
|
<p2 x="300" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="120"/>
|
||||||
|
<p2 x="320" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="120"/>
|
||||||
|
<p2 x="360" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="220"/>
|
||||||
|
<p2 x="320" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="200"/>
|
||||||
|
<p2 x="320" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="100"/>
|
||||||
|
<p2 x="320" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="120"/>
|
||||||
|
<p2 x="320" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="160"/>
|
||||||
|
<p2 x="240" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="160"/>
|
||||||
|
<p2 x="280" y="200"/>
|
||||||
|
</wire>
|
||||||
|
</wires>
|
||||||
|
</circuit>
|
178
src/main/dig/nmos/xor.dig
Normal file
178
src/main/dig/nmos/xor.dig
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<circuit>
|
||||||
|
<version>1</version>
|
||||||
|
<attributes/>
|
||||||
|
<visualElements>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>A</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="220" y="160"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>B</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="220" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NFET</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="260" y="120"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NFET</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="300" y="160"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>PullUp</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="320" y="100"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>PullUp</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="380" y="100"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>NFET</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="360" y="140"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Ground</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="380" y="200"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Y</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="420" y="120"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Testcase</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Testdata</string>
|
||||||
|
<testData>
|
||||||
|
<dataString>A B Y
|
||||||
|
0 0 0
|
||||||
|
0 1 1
|
||||||
|
1 0 1
|
||||||
|
1 1 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# transitions
|
||||||
|
0 0 0
|
||||||
|
0 1 1
|
||||||
|
0 0 0
|
||||||
|
1 0 1
|
||||||
|
0 0 0
|
||||||
|
1 1 0
|
||||||
|
0 0 0
|
||||||
|
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="160" y="40"/>
|
||||||
|
</visualElement>
|
||||||
|
</visualElements>
|
||||||
|
<wires>
|
||||||
|
<wire>
|
||||||
|
<p1 x="220" y="160"/>
|
||||||
|
<p2 x="240" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="160"/>
|
||||||
|
<p2 x="260" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="340" y="180"/>
|
||||||
|
<p2 x="360" y="180"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="220" y="200"/>
|
||||||
|
<p2 x="280" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="200"/>
|
||||||
|
<p2 x="300" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="120"/>
|
||||||
|
<p2 x="320" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="120"/>
|
||||||
|
<p2 x="420" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="120"/>
|
||||||
|
<p2 x="340" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="220"/>
|
||||||
|
<p2 x="320" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="200"/>
|
||||||
|
<p2 x="320" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="100"/>
|
||||||
|
<p2 x="320" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="320" y="120"/>
|
||||||
|
<p2 x="320" y="160"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="240" y="160"/>
|
||||||
|
<p2 x="240" y="220"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="340" y="120"/>
|
||||||
|
<p2 x="340" y="180"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="280" y="160"/>
|
||||||
|
<p2 x="280" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="100"/>
|
||||||
|
<p2 x="380" y="120"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="180"/>
|
||||||
|
<p2 x="380" y="200"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="380" y="120"/>
|
||||||
|
<p2 x="380" y="140"/>
|
||||||
|
</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(188, new FileScanner(this::check).scan(examples));
|
assertEquals(190, new FileScanner(this::check).scan(examples));
|
||||||
assertEquals(87, testCasesInFiles);
|
assertEquals(89, testCasesInFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user