From ec08edbcdaeb8a8c1d6ce07ba50c7d27f2ed459c Mon Sep 17 00:00:00 2001 From: hneemann Date: Thu, 17 Sep 2020 10:14:51 +0200 Subject: [PATCH] adds a Dadda multiplier example --- .../dig/combinatorial/DaddaMultiplier.dig | 2693 +++++++++++++++++ src/main/dig/combinatorial/FullAdder.dig | 28 +- .../digital/integration/TestExamples.java | 4 +- 3 files changed, 2709 insertions(+), 16 deletions(-) create mode 100644 src/main/dig/combinatorial/DaddaMultiplier.dig diff --git a/src/main/dig/combinatorial/DaddaMultiplier.dig b/src/main/dig/combinatorial/DaddaMultiplier.dig new file mode 100644 index 000000000..30ee72851 --- /dev/null +++ b/src/main/dig/combinatorial/DaddaMultiplier.dig @@ -0,0 +1,2693 @@ + + + 1 + + + + In + + + Label + A + + + Bits + 8 + + + intFormat + dec + + + + + + In + + + Label + B + + + Bits + 8 + + + intFormat + dec + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + And + + + Bits + 8 + + + + + + BitExtender + + + inputBits + 1 + + + outputBits + 8 + + + + + + Splitter + + + mirror + true + + + splitterSpreading + 8 + + + Input Splitting + 8 + + + Output Splitting + 7-7,6-6,5-5,4-4,3-3,2-2,1-1,0-0 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 8 + + + Output Splitting + 1*8 + + + + + + Splitter + + + Input Splitting + 1,14,1 + + + Output Splitting + 16 + + + + + + Out + + + Label + Y + + + Bits + 16 + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + FullAdder.dig + + + shapeType + SIMPLE + + + + + + HalfAdder.dig + + + + + Splitter + + + Input Splitting + 1*14 + + + splitterSpreading + 9 + + + Output Splitting + 14 + + + + + + Splitter + + + splitterSpreading + 9 + + + Input Splitting + 1*14 + + + Output Splitting + 14 + + + + + + Add + + + Bits + 14 + + + + + + Testcase + + + Testdata + + A B Y +loop (A,256) +loop (B,256) +(A) (B) (A*B) +end loop +end loop + + + + + + + Ground + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/dig/combinatorial/FullAdder.dig b/src/main/dig/combinatorial/FullAdder.dig index 1bfa82a36..8aaa5dbc7 100644 --- a/src/main/dig/combinatorial/FullAdder.dig +++ b/src/main/dig/combinatorial/FullAdder.dig @@ -202,6 +202,20 @@ + + Out + + + Description + sum {{de Summe}} + + + Label + S_i + + + + Out @@ -217,20 +231,6 @@ - - Out - - - Description - sum {{de Summe}} - - - Label - S_i - - - - Testcase diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index 6ad6d2caa..1c6bc2e31 100644 --- a/src/test/java/de/neemann/digital/integration/TestExamples.java +++ b/src/test/java/de/neemann/digital/integration/TestExamples.java @@ -33,8 +33,8 @@ public class TestExamples extends TestCase { */ public void testDistExamples() throws Exception { File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig"); - assertEquals(299, new FileScanner(this::check).scan(examples)); - assertEquals(195, testCasesInFiles); + assertEquals(300, new FileScanner(this::check).scan(examples)); + assertEquals(196, testCasesInFiles); } /**