improved the documentation
BIN
screenshot.png
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 93 KiB |
@ -5,6 +5,7 @@ import de.neemann.digital.gui.components.AttributeDialog;
|
||||
import de.neemann.digital.gui.components.graphics.GraphicDialog;
|
||||
import de.neemann.digital.gui.components.karnaugh.KarnaughMapDialog;
|
||||
import de.neemann.digital.gui.components.table.TableDialog;
|
||||
import de.neemann.digital.gui.components.testing.TestCaseDescriptionDialog;
|
||||
import de.neemann.digital.integration.GuiTester;
|
||||
import de.neemann.digital.integration.Resources;
|
||||
import de.neemann.digital.lang.Lang;
|
||||
@ -25,17 +26,19 @@ import static de.neemann.digital.draw.shapes.GenericShape.SIZE;
|
||||
*/
|
||||
public class ScreenShots {
|
||||
|
||||
private static final int WIN_DX = 850;
|
||||
private static final int WIN_DY = 500;
|
||||
private static GraphicDialog graphic;
|
||||
|
||||
public static void main(String[] args) {
|
||||
mainScreenShot();
|
||||
// mainScreenShot();
|
||||
// firstSteps();
|
||||
hierarchicalDesign();
|
||||
}
|
||||
|
||||
private static void mainScreenShot() {
|
||||
Lang.setActualRuntimeLanguage(new Language("en"));
|
||||
new GuiTester("../../main/dig/processor/Processor.dig")
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, m) -> m.setTitle("Processor.dig - Digital")))
|
||||
new GuiTester("../../main/dig/processor/Processor.dig", "examples/processor/Processor.dig")
|
||||
.press(' ')
|
||||
.delay(500)
|
||||
.add(new GuiTester.WindowCheck<>(GraphicDialog.class, (gt, gd) -> {
|
||||
@ -53,12 +56,11 @@ public class ScreenShots {
|
||||
}
|
||||
|
||||
// Set all settings as needed before start this method
|
||||
public static void firstSteps() {
|
||||
private static void firstSteps() {
|
||||
int x = 300;
|
||||
int y = 180;
|
||||
new GuiTester()
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, w) -> w.setSize(850, 500)))
|
||||
.add(new ScreenShot<>(Main.class))
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, w) -> w.setSize(WIN_DX, WIN_DY)))
|
||||
// input
|
||||
.press("F10")
|
||||
.press("RIGHT", 5)
|
||||
@ -128,23 +130,67 @@ public class ScreenShots {
|
||||
location.x += 10;
|
||||
location.y += 10;
|
||||
td.setLocation(location);
|
||||
td.getContentPane().setPreferredSize(new Dimension(400, 400));
|
||||
td.getContentPane().setPreferredSize(new Dimension(370, 400));
|
||||
td.pack();
|
||||
}))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(TableDialog.class).useParent())
|
||||
// k-map
|
||||
.press("F10")
|
||||
.press("RIGHT", 5)
|
||||
.press("DOWN", 1)
|
||||
.add(new ScreenShot<>(TableDialog.class).useParent())
|
||||
.press("ENTER")
|
||||
// k-map
|
||||
.delay(500)
|
||||
.add(new GuiTester.WindowCheck<>(KarnaughMapDialog.class, (gt, td) -> {
|
||||
td.getContentPane().setPreferredSize(new Dimension(300, 300));
|
||||
td.pack();
|
||||
}))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(KarnaughMapDialog.class).useParent().useParent())
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
||||
private static void hierarchicalDesign() {
|
||||
ScreenShot.n = 20;
|
||||
new GuiTester("dig/test/docu/halfAdder.dig", "halfAdder.dig")
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, w) -> w.setSize(WIN_DX, WIN_DY)))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(Main.class))
|
||||
.execute();
|
||||
new GuiTester("dig/test/docu/fullAdder.dig", "fullAdder.dig")
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, w) -> w.setSize(WIN_DX, WIN_DY)))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(Main.class))
|
||||
.execute();
|
||||
new GuiTester("dig/test/docu/rcAdder.dig", "rcAdder.dig")
|
||||
.add(new GuiTester.WindowCheck<>(Main.class, (gt, w) -> w.setSize(WIN_DX, WIN_DY)))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(Main.class))
|
||||
.add(new ClickAtCircuit(600, 380, InputEvent.BUTTON3_MASK))
|
||||
.delay(500)
|
||||
.add(new GuiTester.WindowCheck<>(AttributeDialog.class, (gt, w) -> {
|
||||
Point p = w.getLocation();
|
||||
p.y -= 50;
|
||||
w.setLocation(p);
|
||||
}))
|
||||
.delay(500)
|
||||
.press("TAB", "SPACE")
|
||||
.delay(500)
|
||||
.add(new GuiTester.WindowCheck<>(TestCaseDescriptionDialog.class, (gt, w) -> {
|
||||
Point p = w.getLocation();
|
||||
p.y -= 50;
|
||||
w.setLocation(p);
|
||||
w.getContentPane().setPreferredSize(new Dimension(400, 300));
|
||||
w.pack();
|
||||
}))
|
||||
.delay(500)
|
||||
.add(new ScreenShot<>(TestCaseDescriptionDialog.class).useParent().useParent())
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
||||
private static class MainScreenShot extends GuiTester.WindowCheck<Main> {
|
||||
|
||||
MainScreenShot() {
|
||||
|
@ -23,14 +23,20 @@ public class GuiTester {
|
||||
private final ArrayList<Runnable> runnableList;
|
||||
private Main main;
|
||||
private String filename;
|
||||
private final String displayName;
|
||||
private Robot robot;
|
||||
|
||||
public GuiTester() {
|
||||
this(null);
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
public GuiTester(String filename) {
|
||||
this(filename, null);
|
||||
}
|
||||
|
||||
public GuiTester(String filename, String displayName) {
|
||||
this.filename = filename;
|
||||
this.displayName = displayName;
|
||||
runnableList = new ArrayList<>();
|
||||
}
|
||||
|
||||
@ -152,6 +158,8 @@ public class GuiTester {
|
||||
if (filename != null) {
|
||||
File file = new File(Resources.getRoot(), filename);
|
||||
main = new Main.MainBuilder().setFileToOpen(file).build();
|
||||
if (displayName!=null)
|
||||
SwingUtilities.invokeLater(() -> main.setTitle(displayName + " - Digital"));
|
||||
} else
|
||||
main = new Main.MainBuilder().setCircuit(new Circuit()).build();
|
||||
main.setVisible(true);
|
||||
|
@ -40,8 +40,8 @@ public class TestExamples extends TestCase {
|
||||
*/
|
||||
public void testTestExamples() throws Exception {
|
||||
File examples = new File(Resources.getRoot(), "/dig/test");
|
||||
assertEquals(117, new FileScanner(this::check).scan(examples));
|
||||
assertEquals(107, testCasesInFiles);
|
||||
assertEquals(120, new FileScanner(this::check).scan(examples));
|
||||
assertEquals(108, testCasesInFiles);
|
||||
}
|
||||
|
||||
|
||||
|
138
src/test/resources/dig/test/docu/fullAdder.dig
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes/>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>halfAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="360" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>halfAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="460" y="100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>B</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="220"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Ci</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Co</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="640" y="160"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Or</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="560" y="140"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>S</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="640" y="100"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="620" y="160"/>
|
||||
<p2 x="640" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="440" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="180"/>
|
||||
<p2 x="360" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="180"/>
|
||||
<p2 x="560" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="100"/>
|
||||
<p2 x="460" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="100"/>
|
||||
<p2 x="640" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="120"/>
|
||||
<p2 x="460" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="120"/>
|
||||
<p2 x="540" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="200"/>
|
||||
<p2 x="540" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="340" y="200"/>
|
||||
<p2 x="360" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="220"/>
|
||||
<p2 x="340" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="140"/>
|
||||
<p2 x="560" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="340" y="200"/>
|
||||
<p2 x="340" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="120"/>
|
||||
<p2 x="440" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="120"/>
|
||||
<p2 x="540" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="180"/>
|
||||
<p2 x="540" y="200"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
99
src/test/resources/dig/test/docu/halfAdder.dig
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes/>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>XOr</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="600" y="240"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>And</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="600" y="320"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>$A$</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="540" y="240"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>$B$</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="540" y="360"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>$S$</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="720" y="260"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>$C$</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="720" y="340"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="560" y="240"/>
|
||||
<p2 x="580" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="580" y="280"/>
|
||||
<p2 x="560" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="580" y="320"/>
|
||||
<p2 x="600" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="240"/>
|
||||
<p2 x="560" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="240"/>
|
||||
<p2 x="600" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="660" y="260"/>
|
||||
<p2 x="720" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="660" y="340"/>
|
||||
<p2 x="720" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="580" y="280"/>
|
||||
<p2 x="600" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="360"/>
|
||||
<p2 x="560" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="360"/>
|
||||
<p2 x="600" y="360"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
352
src/test/resources/dig/test/docu/rcAdder.dig
Normal file
@ -0,0 +1,352 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes/>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Ci</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="260"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A0</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>B0</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="220"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>S0</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="220"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Co</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="-140"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>fullAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="440" y="200"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A1</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="80"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>B1</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="120"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>S1</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="120"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>fullAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="440" y="100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A2</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="-20"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>B2</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="20"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>S2</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="20"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>fullAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="440" y="0"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A3</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="-120"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>B3</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="360" y="-80"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>S3</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="-80"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>fullAdder.dig</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="440" y="-100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Testcase</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Testdata</string>
|
||||
<testData>
|
||||
<dataString> Ci A3 A2 A1 A0 B3 B2 B1 B0 Co S3 S2 S1 S0
|
||||
|
||||
loop(A,16)
|
||||
loop(B,16)
|
||||
0 bits(4,A) bits(4,B) bits(5,A+B)
|
||||
1 bits(4,A) bits(4,B) bits(5,A+B+1)
|
||||
end loop
|
||||
end loop</dataString>
|
||||
</testData>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="680" y="220"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="380" y="0"/>
|
||||
<p2 x="440" y="0"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="0"/>
|
||||
<p2 x="520" y="0"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="-100"/>
|
||||
<p2 x="440" y="-100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="-100"/>
|
||||
<p2 x="520" y="-100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="260"/>
|
||||
<p2 x="380" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="100"/>
|
||||
<p2 x="440" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="100"/>
|
||||
<p2 x="520" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="200"/>
|
||||
<p2 x="440" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="200"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="40"/>
|
||||
<p2 x="440" y="40"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="-140"/>
|
||||
<p2 x="580" y="-140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="140"/>
|
||||
<p2 x="440" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="-80"/>
|
||||
<p2 x="440" y="-80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="-80"/>
|
||||
<p2 x="580" y="-80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="240"/>
|
||||
<p2 x="440" y="240"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="80"/>
|
||||
<p2 x="520" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="80"/>
|
||||
<p2 x="380" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="-20"/>
|
||||
<p2 x="520" y="-20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="-20"/>
|
||||
<p2 x="380" y="-20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="180"/>
|
||||
<p2 x="520" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="180"/>
|
||||
<p2 x="380" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="20"/>
|
||||
<p2 x="440" y="20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="20"/>
|
||||
<p2 x="580" y="20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="-120"/>
|
||||
<p2 x="380" y="-120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="120"/>
|
||||
<p2 x="440" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="120"/>
|
||||
<p2 x="580" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="-60"/>
|
||||
<p2 x="440" y="-60"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="220"/>
|
||||
<p2 x="440" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="220"/>
|
||||
<p2 x="580" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="140"/>
|
||||
<p2 x="420" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="40"/>
|
||||
<p2 x="420" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="-60"/>
|
||||
<p2 x="420" y="-20"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="180"/>
|
||||
<p2 x="520" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="-20"/>
|
||||
<p2 x="520" y="0"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="80"/>
|
||||
<p2 x="520" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="-140"/>
|
||||
<p2 x="520" y="-100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="180"/>
|
||||
<p2 x="380" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="240"/>
|
||||
<p2 x="380" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="80"/>
|
||||
<p2 x="380" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="-20"/>
|
||||
<p2 x="380" y="0"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="380" y="-120"/>
|
||||
<p2 x="380" y="-100"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 32 KiB |
BIN
src/test/resources/docu/images/de/scr20.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
src/test/resources/docu/images/de/scr21.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
src/test/resources/docu/images/de/scr22.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
src/test/resources/docu/images/de/scr23.png
Normal file
After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB |
BIN
src/test/resources/docu/images/en/scr20.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
src/test/resources/docu/images/en/scr21.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
src/test/resources/docu/images/en/scr22.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
src/test/resources/docu/images/en/scr23.png
Normal file
After Width: | Height: | Size: 56 KiB |
@ -3,8 +3,9 @@
|
||||
<chapter name="Digital">
|
||||
<subchapter name="Einführung">
|
||||
<par>
|
||||
Digital ist ein Simulator für digitale Schaltkreise. Die einzelnen Gatter eines Schaltkreise können
|
||||
miteinander durch Leitungen verbunden werden und das Verhalten der Gesamtschaltung wird simuliert.
|
||||
Digital ist ein Simulator für digitale Schaltkreise. Ein Schaltung besteht dabei aus einer
|
||||
Anzahl logischer Gatter welche miteinander durch Leitungen verbunden sind.
|
||||
Das Verhalten der Gesamtschaltung wird dann simuliert.
|
||||
Der Anwender kann mit der laufenden Simulation über bestimmte Elemente interagieren, indem z.B. Knöpfe
|
||||
betätigt oder Eingänge gesetzt werden.
|
||||
</par>
|
||||
@ -14,104 +15,99 @@
|
||||
finden sich viele Beispiele bis hin zum funktionsfähigen 16-Bit Single Cycle Harvard Prozessor.
|
||||
</par>
|
||||
<par>
|
||||
Der Simulator kennt dabei zwei Modi: Im Bearbeitungsmodus kann die Schaltung bearbeitet werden. Es
|
||||
können Elemente hinzugefügt oder durch Leitungen verbunden werden. In diesem Modus ist die eigentliche
|
||||
Simulation nicht aktiv.
|
||||
Der Simulator kennt dabei zwei Modi: Im Bearbeitungsmodus kann die Schaltung bearbeitet werden.
|
||||
In diesem Modus ist die eigentliche Simulation nicht aktiv.
|
||||
Der Simulationsmodus wird durch den <e>Start</e>-Knopf aktiviert. Beim Wechsel in diesen Modus wird die Schaltung
|
||||
auf Konsistenz überprüft. Gibt es in der Schaltung noch Fehler, wird eine entsprechende Meldung
|
||||
angezeigt.
|
||||
Wenn möglich werden die betroffenen Elemente bzw. Leitungen hervorgehoben. Enthält die Schaltung keine
|
||||
Fehler mehr, wird die Simulation aktiviert. Jetzt kann mit der laufenden Simulation interagiert werden.
|
||||
Die Bearbeitung der Elemente ist dann jedoch nicht mehr möglich. Dazu muss erneut in den
|
||||
Bearbeitungsmodus gewechselt werden, indem die Simulation gestoppt wird.
|
||||
auf Konsistenz überprüft.
|
||||
Enthält die Schaltung keine Fehler, wird die Simulation aktiviert.
|
||||
Jetzt kann mit der laufenden Simulation interagiert werden.
|
||||
Soll die Schaltung weiter bearbeitet werden, muss die Simulation wieder gestoppt werden.
|
||||
</par>
|
||||
</subchapter>
|
||||
<subchapter name="Erste Schritte">
|
||||
<par>
|
||||
<image src="scr00.png">
|
||||
Als erstes Beispiel soll eine Schaltung mit einem Exklusiv-Oder Gatter aufgebaut werden.
|
||||
Im Hauptfenster können aus dem Menü <e>Bauteile</e> die verschiedenen Bauteile ausgewählt werden.
|
||||
Danach werden diese auf dem Zeichenfeld positioniert. Das Positionieren kann mit der ESC-Taste
|
||||
jederzeit abgebrochen werden.
|
||||
Als erstes soll ein Eingang der Schaltung hinzugefügt werden. Dieser lässt sich später interaktiv
|
||||
mit der Maus steuern.
|
||||
</image>
|
||||
<image src="scr01.png">
|
||||
Als erstes Beispiel kann eine Schaltung mit einem Exklusiv-Oder Gatter aufgebaut werden.
|
||||
Dazu wählt man zunächst einen Eingang aus. Dieser kann später interaktiv mit der Maus
|
||||
gesteuert werden.
|
||||
</image>
|
||||
<image src="scr02.png">
|
||||
Nach der Auswahl kann der erste Eingang auf die Zeichenfläche gesetzt werden.
|
||||
Der rote Punkt markiert den Leitungsanschluss. Hier wird später eine Verbindungsleitung
|
||||
angeschlossen. Rot zeigt an, dass dieser Anschluss aktiv ist. Er definiert also einen
|
||||
Signalwert.
|
||||
</image>
|
||||
<image src="scr03.png">
|
||||
<image src="scr02.png">
|
||||
Auf die gleiche Art und Weise wird ein zweiter Eingang hinzugefügt. Am besten setzt man
|
||||
ihn direkt unter den ersten Eingang.
|
||||
</image>
|
||||
<image src="scr04.png">
|
||||
<image src="scr03.png">
|
||||
Danach wird das Exklusiv-Oder Gatter ausgewählt. Dieses Gatter stellt die eigentliche
|
||||
logische Funktion dar.
|
||||
</image>
|
||||
<image src="scr05.png">
|
||||
<image src="scr04.png">
|
||||
Dieses kann nun ebenfalls in die Schaltung eingefügt werden. Am besten setzt man es so,
|
||||
dass die spätere Verdrahtung möglichst einfach wird. Die blauen Punkte bezeichnen die
|
||||
Eingänge des Gatters.
|
||||
</image>
|
||||
<image src="scr06.png">
|
||||
<image src="scr05.png">
|
||||
Jetzt wählt man noch einen Ausgang aus. Dieser kann verwendet werden, um einen Zustand
|
||||
anzuzeigen, oder um später Signale an eine einbettende Schaltung weiterzugeben.
|
||||
</image>
|
||||
<image src="scr07.png">
|
||||
<image src="scr06.png">
|
||||
Auch dieser wird so positioniert, dass die Verdrahtung möglichst einfach wird.
|
||||
Er hat einen blauen Punkt, verfügt also über einen Eingang.
|
||||
</image>
|
||||
<image src="scr08.png">
|
||||
<image src="scr07.png">
|
||||
Damit sind alle Komponenten vorhanden. Jetzt muss noch die Verdrahtung ergänzt werden.
|
||||
Mit der Maus kann direkt eine Verbindungsleitung gezogen werden. Es werden die blauen und roten
|
||||
Punkte miteinander verbunden. Es darf dabei immer nur genau ein roter Punkt mit einer beliebigen
|
||||
Anzahl blauer Punkte verbunden werden. Nur der Einsatz von Threestate-Ausgängen erlaubt es,
|
||||
von dieser Regel abzuweichen und mehrere rote Punkte miteinander zu verbinden.
|
||||
</image>
|
||||
<image src="scr09.png">
|
||||
<image src="scr08.png">
|
||||
So können auch die beiden noch fehlenden Leitungen ergänzt werden. Damit ist eine erste
|
||||
Schaltung komplett.
|
||||
</image>
|
||||
<image src="scr10.png">
|
||||
<image src="scr09.png">
|
||||
Um mit der Schaltung interagieren zu können, muss diese gestartet werden. Dazu kann der
|
||||
Start-Knopf in der Toolbar verwendet werden.
|
||||
Nach dem Starten der Simulation ändert sich die Farbe der Leitungen und die Ein- und Ausgänge
|
||||
sind jetzt ausgefüllt. Ein helles Grün markiert eine logische '1' und ein dunkles Grün eine
|
||||
logische '0'. Im Moment findet sich auf allen Leitungen eine logische '0'.
|
||||
</image>
|
||||
<image src="scr11.png">
|
||||
<image src="scr10.png">
|
||||
Durch Klicken mit der Maus können die Eingänge umgeschaltet werden. Da die Simulation jetzt
|
||||
aktiv ist, verändert sich der Ausgang entsprechend der aktuellen Eingangszustände.
|
||||
Die Schaltung verhält sich wie erwartet wie ein XOR-Gatter.
|
||||
</image>
|
||||
<image src="scr12.png">
|
||||
<image src="scr11.png">
|
||||
Um die Schaltung weiter bearbeiten zu können, muss die Simulation zunächst gestoppt werden.
|
||||
Dies geschieht am einfachsten mit dem Stopp-Knopf in der ToolBar.
|
||||
Durch Klicken mit der rechten Maustaste auf eine Komponente öffnet sich ein Dialog, welcher die
|
||||
Eigenschaften dieser Komponente anzeigt. Für den ersten Eingang kann über diesen Dialog die
|
||||
Bezeichnung 'A' festgelegt werden.
|
||||
</image>
|
||||
<image src="scr13.png">
|
||||
<image src="scr12.png">
|
||||
Auf diese Weise können die Bezeichnungen für die übrigen Ein- und Ausgänge definiert werden.
|
||||
Im Hauptmenü im Menüpunkt <e>Analyse</e> findet sich auch ein Menüpunkt <e>Analyse</e>. Damit lässt sich
|
||||
eine Analyse der aktuellen Schaltung durchführen. Dies ist jedoch nur möglich, wenn alle Ein- und
|
||||
Ausgänge mit einer Bezeichnung versehen sind.
|
||||
</image>
|
||||
<image src="scr14.png">
|
||||
<image src="scr13.png">
|
||||
Es öffnet sich ein Fenster, welches die Wahrheitstabelle der aktuellen Schaltung zeigt. Unter der
|
||||
Tabelle findet sich der algebraische Ausdruck, welcher zu der Schaltung gehört. Gibt es mehrere
|
||||
mögliche algebraische Ausdrücke, öffnet sich ein separates Fenster, welches alle Ausdrücke
|
||||
anzeigt.
|
||||
</image>
|
||||
<image src="scr15.png">
|
||||
<image src="scr14.png">
|
||||
Der Tabellendialog hat in seinem Hauptmenü den Menüeintrag <e>KV-Tafel</e>. Über diesen lässt sich die
|
||||
Wahrheitstabelle in Form einer KV-Tafel anzeigen.
|
||||
</image>
|
||||
<image src="scr16.png">
|
||||
<image src="scr15.png">
|
||||
Oben in diesem Dialog gibt es eine Auswahlbox über welche der gewünschte Ausdruck in der KV-Tafel
|
||||
ausgewählt werden kann. Auf diese Weise lässt sich z.B. verdeutlichen, wie sich mehrere äquivalente
|
||||
algebraische Ausdrücke ergeben können. Durch Klicken in der KV-Tafel lässt sich die Tabelle bearbeiten.
|
||||
@ -147,17 +143,49 @@
|
||||
Dateien unabhängig von einander in einem Versionskontrollsystem abgelegt und Änderungen verfolgt werden
|
||||
können.
|
||||
</par>
|
||||
<par><image src="scr20.png"/></par>
|
||||
<par>
|
||||
Dabei werden in einer Schaltung nur die Dateinamen der Teilschaltungen gespeichert. Die entsprechenden
|
||||
Dateien der eingebundenen Teilschaltungen müssen daher zur Laufzeit der Simulation im Dateisystem
|
||||
gefunden
|
||||
werden. Um die verschiedenen Arbeitsweisen der Nutzer bestmöglich zu unterstützen und dennoch
|
||||
Als Beispiel sei ein 4 Bit Addierer betrachtet: Zunächst wir ein einfacher Halbaddierer aufgebaut.
|
||||
Dieser besteht aus einem XOr-Gatter und einem UND-Gatter. Die Summe der beiden Bits 'A' und 'B' wird
|
||||
an den Ausgängen 'S' und 'C' ausgegeben. Diese Schaltung wird in der Datei <e>halfAdder.dig</e>
|
||||
gespeichert.
|
||||
</par>
|
||||
<par><image src="scr21.png"/></par>
|
||||
<par>
|
||||
Aus zwei Halbaddierern kann nun ein Volladdierer aufgebaut werden. Dazu erzeugt man eine neue leere
|
||||
Datei und speichert die leere Datei unter dem Name <e>fullAdder.dig</e> im selben Ordner wie zuvor den
|
||||
Halbaddierer. Danach kann der Halbaddier über das Menu <e>Bauteile</e><arrow/><e>Benutzerdefiniert</e>
|
||||
der neuen Schaltung hinzugefügt werden. Der Volladdierer addiert die drei Bits 'A', 'B' und 'Ci' und gibt
|
||||
die Summe an 'S' und 'Co' aus.
|
||||
</par>
|
||||
<par><image src="scr22.png"/></par>
|
||||
<par>
|
||||
Nun lassen sich die Volladdierer zu einem so gen. Ripple-Carry Addierer zusammensetzen. Dabei wird
|
||||
der Carry-Ausgang einer Addition als Carry-Eingang an die Addition des nächst höherwertigen Bits
|
||||
weitergegeben. Genau so, wie es bei der schriftlichen Addition üblich ist. Dieser 4-Bitt Addierer soll
|
||||
auf korrekte Funktion überprüft werden. Dazu wurde ein Testfall eingefügt.
|
||||
</par>
|
||||
<par><image src="scr23.png"/></par>
|
||||
<par>
|
||||
Dieser Testfall führt einen 100% Test durch, was nur bei relativ einfachen Schaltungen möglich ist:
|
||||
Alle möglichen 512 Eingangskombinationen werden an die
|
||||
Schaltung angelegt, und es wird überprüft, ob die Ausgabe der Schaltung korrekt ist. Dazu werden die
|
||||
Variablen <e>A</e> und <e>B</e> jeweils von 0 bis 15 durchlaufen. Die jeweiligen Werte von <e>A</e> und
|
||||
<e>B</e> werden dann den Eingängen 'A' und 'B' zugewiesen. Dann wird überprüft, ob die Schaltung den
|
||||
Wert <e>A+B</e> ausgibt. Das Ganze wird dann noch einmal mit gesetztem Carry-Bit geprüft, wobei sich
|
||||
dann <e>A+B+1</e> ergeben muss. Die Detals der Test-Syntax liefert der Hilfe-Dialog.
|
||||
</par>
|
||||
<par>
|
||||
Wenn eine Schaltung in eine andere Schaltungen eingebunden wird, wird in der einbindenden Schaltung nur
|
||||
der Dateiname der Schaltung gespeichert, nicht die Schaltung selbst. Die entsprechenden
|
||||
Dateien der eingebundenen Schaltungen müssen daher zur Laufzeit der Simulation im Dateisystem
|
||||
gefunden werden. Um die verschiedenen Arbeitsweisen der Nutzer bestmöglich zu unterstützen und dennoch
|
||||
auf eine komplexe Verwaltung von Importpfaden usw. zu verzichten, ist eine etwas ungewöhnliche
|
||||
Import-Strategie implementiert.
|
||||
</par>
|
||||
<par>
|
||||
In einer Schaltung sind nur die Dateinamen der eingebetteten Schaltungen gespeichert. Soll die Datei
|
||||
geöffnet werden,
|
||||
In einer Schaltung sind nur die Dateinamen der eingebetteten Schaltungen gespeichert, kein kompletter
|
||||
Pfad. Soll die Datei geöffnet werden,
|
||||
werden alle Unterordner nach einer Datei des entsprechenden Namens durchsucht. Wird
|
||||
eine passende Datei gefunden, wird diese importiert. Dabei kommt es nur auf den Dateinamen der
|
||||
einzulesenden
|
||||
|
@ -27,78 +27,77 @@
|
||||
<subchapter name="First Steps">
|
||||
<par>
|
||||
<image src="scr00.png">
|
||||
As a first example, we want to build a circuit with an Exclusive-Or gate.
|
||||
In the main window, the various components can be selected from the menu <e>Components</e>.
|
||||
Then they are positioned on the drawing field. This process can be aborted with the ESC key
|
||||
Then they are placed on the drawing panel. This process can be aborted with the ESC key
|
||||
at any time.
|
||||
</image>
|
||||
<image src="scr01.png">
|
||||
As a first example, a circuit with an exclusive OR gate can be constructed.
|
||||
To do this, first select an input component.
|
||||
At first select an input component.
|
||||
This can later be controlled interactively with the mouse.
|
||||
</image>
|
||||
<image src="scr02.png">
|
||||
<image src="scr01.png">
|
||||
After selection, the first input can be placed on the drawing surface. The red dot marks the wire
|
||||
connection. Here, a wire will be connected later. Red indicates that this port is active.
|
||||
So he defines a signal value.
|
||||
</image>
|
||||
<image src="scr03.png">
|
||||
<image src="scr02.png">
|
||||
In the same way, a second input is added. It is best to put it directly under the first input.
|
||||
</image>
|
||||
<image src="scr04.png">
|
||||
<image src="scr03.png">
|
||||
Thereafter, the Exclusive-Or gate is selected. This gate represents the actual logical function.
|
||||
</image>
|
||||
<image src="scr05.png">
|
||||
<image src="scr04.png">
|
||||
This gate can now also be inserted in the circuit. It is best to set it in a way that the subsequent
|
||||
wiring is as simple as possible. The blue dots indicate the inputs of the gate.
|
||||
</image>
|
||||
<image src="scr06.png">
|
||||
<image src="scr05.png">
|
||||
Now select an output. This can be used to indicate a signal state or to later pass signals to
|
||||
an embedding circuit.
|
||||
</image>
|
||||
<image src="scr07.png">
|
||||
<image src="scr06.png">
|
||||
This is also positioned so that the wiring become as simple as possible.
|
||||
He has a blue dot, so has an input.
|
||||
</image>
|
||||
<image src="scr08.png">
|
||||
<image src="scr07.png">
|
||||
Now all necessary components are present. At next the wiring has to be added. With the mouse
|
||||
directly a wire can be drawn. The blue and red dots are connected. Only one red dot may be
|
||||
connected to any number of blue dots. Only the use of threestate outputs makes it possible to
|
||||
deviate from this rule and to connect several red dots.
|
||||
</image>
|
||||
<image src="scr09.png">
|
||||
<image src="scr08.png">
|
||||
So also the two missing lines can be drawn. This completes a first circuit.
|
||||
</image>
|
||||
<image src="scr10.png">
|
||||
<image src="scr09.png">
|
||||
To be able to interact with the circuit, it must be started. The start button in the toolbar can
|
||||
be used for this purpose. After starting the simulation, the color of the wires changes and the
|
||||
inputs and outputs are now filled. A bright green marks a logical '1' and a dark green a logical '0'.
|
||||
At the moment there is a logical '0' on all wires.
|
||||
</image>
|
||||
<image src="scr11.png">
|
||||
<image src="scr10.png">
|
||||
By clicking with the mouse, the inputs can be switched. Since the simulation is now active, the
|
||||
output changes according to the current input states. The circuit behaves as expected like an XOR gate.
|
||||
output changes according to the current input states. The circuit behaves as expected like an
|
||||
Exclusive-Or gate.
|
||||
</image>
|
||||
<image src="scr12.png">
|
||||
<image src="scr11.png">
|
||||
To further process the circuit, the simulation must first be stopped. The easiest way to do this is
|
||||
with the Stop button in the ToolBar. Clicking on a component with the right mouse button opens a
|
||||
dialog which displays the properties of this component. The name 'A' can be defined for the first
|
||||
input via this dialog.
|
||||
</image>
|
||||
<image src="scr13.png">
|
||||
<image src="scr12.png">
|
||||
In this way, the names for the remaining inputs and outputs can be defined. The menu item
|
||||
<e>Analysis</e> also contains a menu item <e>Analysis</e>. This function performs an analysis of
|
||||
the current circuit. However, this is only possible if all inputs and outputs are labeled.
|
||||
</image>
|
||||
<image src="scr14.png">
|
||||
<image src="scr13.png">
|
||||
It opens a window showing the truth table of the current circuit. Below the table is the algebraic
|
||||
expression associated with the circuit. If there are several possible algebraic expressions, a
|
||||
separate window will open showing all expressions.
|
||||
</image>
|
||||
<image src="scr15.png">
|
||||
<image src="scr14.png">
|
||||
The table dialog has the menu entry <e>K-Map</e> in its main menu. This allows to display the truth
|
||||
table in the form of a K-map.
|
||||
</image>
|
||||
<image src="scr16.png">
|
||||
<image src="scr15.png">
|
||||
At the top of this dialog there is a drop-down list which allows the selection of the desired
|
||||
expression in the K-map. In this way you can, for example, illustrate how several equivalent
|
||||
algebraic expressions can result. By clicking in the K-map the table can be modified.
|
||||
@ -126,20 +125,52 @@
|
||||
</subchapter>
|
||||
<subchapter name="Hierarchical Design">
|
||||
<par>
|
||||
If a very complex circuit is built up, this can very quickly become very confusing. To keep track here,
|
||||
If a complex circuit is built up, this can very quickly become very confusing. To keep track here,
|
||||
the different parts of a circuit can be stored in different files. This mechanism also makes it
|
||||
possible to use a subcircuit, which has been created once, several times in a further circuit.
|
||||
This approach also offers the advantage that the files can be stored independently of each other in a
|
||||
version control system and changes can be tracked.
|
||||
</par>
|
||||
<par><image src="scr20.png"/></par>
|
||||
<par>
|
||||
In this case, only the file names of the subcircuits are stored in a circuit. The corresponding files of
|
||||
the integrated subcircuits must therefore be found at the runtime of the simulation in the file system.
|
||||
As an example, consider a 4-bit adder: First, we built a simple half-adder. This consists of an
|
||||
XOR gate and an AND gate. The sum of the two bits 'A' and 'B' is given to the outputs 'S' and 'C'.
|
||||
This circuit is stored in the file <e>halfAdder.dig</e> file.
|
||||
</par>
|
||||
<par><image src="scr21.png"/></par>
|
||||
<par>
|
||||
From two half adders a full adder can now be built. To do this, create a new empty file and save the
|
||||
empty file under the name <e>fullAdder.dig</e> in the same folder as before the half adder. Then the
|
||||
half adder can be added to the new circuit via the <e>Components</e><arrow/><e>Custom</e> menu.
|
||||
The full adder adds the three bits 'A', 'B' and 'Ci' and gives the sum to th outputs 'S' and 'Co'.
|
||||
</par>
|
||||
<par><image src="scr22.png"/></par>
|
||||
<par>
|
||||
Now the full adders can be put together to form a so-called ripple-carry adder.
|
||||
In this case, the carry output of an addition is forwarded as a carry input to the addition of the
|
||||
next higher-order bit. Just as it is usual in written addition.
|
||||
This 4-bit adder should be checked for correct function. For this purpose a test case was inserted.
|
||||
</par>
|
||||
<par><image src="scr23.png"/></par>
|
||||
<par>
|
||||
This test case performs a 100% test, which is possible only with relatively simple circuits: all
|
||||
possible 512 input combinations are applied to the circuit, and it is checked whether the output
|
||||
of the circuit is correct. For this purpose, the variables <e>A</e> and <e>B</e> are each traversed
|
||||
from 0 to 15. The respective values of <e>A</e> and <e>B </e> are then assigned to inputs 'A' and 'B'.
|
||||
Then it is checked whether the circuit outputs the value <e>A+B</e>. Then it is checked again with
|
||||
the carry bit set, in which case <e>A+B+1</e> must result.
|
||||
The details of the test syntax are provided by the help dialog.
|
||||
</par>
|
||||
<par>
|
||||
If a circuit is embedded in an other ciruit, only the file name of the subcircuit are stored in a
|
||||
circuit, not the embedded circuit itself.
|
||||
The corresponding files of
|
||||
the embedded subcircuits must therefore be found in the file system at runtime of the simulation.
|
||||
In order to support the various work methods of the users as best as possible and still to avoid a
|
||||
complex administration of import paths, etc., a somewhat unusual import strategy is implemented.
|
||||
</par>
|
||||
<par>
|
||||
Only the file names of the embedded circuits are stored in a circuits file.
|
||||
Only the file names of the embedded circuits are stored in a circuits file, not the full path.
|
||||
If a file needs to be opened, all subfolders are searched for a file of the corresponding name.
|
||||
If a suitable file is found, it is imported. This process only depends on the file name of the file to
|
||||
be read, not on its path. Correspondingly, an error message is generated if there are several files of
|
||||
|