Error in the DMux8Way.tst and .cmp files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Error in the DMux8Way.tst and .cmp files

chungy
I believe this is a genuine bug/oversight. While the script can run fine without this fix, DMux8Way is expecting three bits for the sel input, but the compare file only shows two. This made me a bit confused looking at the file and trying to work out the logic, until I realized what's going on.

Since I've been doing my work in Git, I've made a patch for it:
diff --git a/01/DMux8Way.cmp b/01/DMux8Way.cmp
index b34c563..ebf9304 100644
--- a/01/DMux8Way.cmp
+++ b/01/DMux8Way.cmp
@@ -1,17 +1,17 @@
-| in  | sel  |  a  |  b  |  c  |  d  |  e  |  f  |  g  |  h  |
-|  0  |  00  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  01  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  10  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  11  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  00  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  01  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  10  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  0  |  11  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  1  |  00  |  1  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  1  |  01  |  0  |  1  |  0  |  0  |  0  |  0  |  0  |  0  |
-|  1  |  10  |  0  |  0  |  1  |  0  |  0  |  0  |  0  |  0  |
-|  1  |  11  |  0  |  0  |  0  |  1  |  0  |  0  |  0  |  0  |
-|  1  |  00  |  0  |  0  |  0  |  0  |  1  |  0  |  0  |  0  |
-|  1  |  01  |  0  |  0  |  0  |  0  |  0  |  1  |  0  |  0  |
-|  1  |  10  |  0  |  0  |  0  |  0  |  0  |  0  |  1  |  0  |
-|  1  |  11  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  1  |
+| in  |  sel  |  a  |  b  |  c  |  d  |  e  |  f  |  g  |  h  |
+|  0  |  000  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  001  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  010  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  011  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  100  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  101  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  110  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  0  |  111  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  1  |  000  |  1  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  1  |  001  |  0  |  1  |  0  |  0  |  0  |  0  |  0  |  0  |
+|  1  |  010  |  0  |  0  |  1  |  0  |  0  |  0  |  0  |  0  |
+|  1  |  011  |  0  |  0  |  0  |  1  |  0  |  0  |  0  |  0  |
+|  1  |  100  |  0  |  0  |  0  |  0  |  1  |  0  |  0  |  0  |
+|  1  |  101  |  0  |  0  |  0  |  0  |  0  |  1  |  0  |  0  |
+|  1  |  110  |  0  |  0  |  0  |  0  |  0  |  0  |  1  |  0  |
+|  1  |  111  |  0  |  0  |  0  |  0  |  0  |  0  |  0  |  1  |
diff --git a/01/DMux8Way.tst b/01/DMux8Way.tst
index 536146d..91469bf 100644
--- a/01/DMux8Way.tst
+++ b/01/DMux8Way.tst
@@ -6,7 +6,7 @@
 load DMux8Way.hdl,
 output-file DMux8Way.out,
 compare-to DMux8Way.cmp,
-output-list in%B2.1.2 sel%B2.2.2 a%B2.1.2 b%B2.1.2 c%B2.1.2 d%B2.1.2 e%B2.1.2 f%B2.1.2 g%B2.1.2 h%B2.1.2;
+output-list in%B2.1.2 sel%B2.3.2 a%B2.1.2 b%B2.1.2 c%B2.1.2 d%B2.1.2 e%B2.1.2 f%B2.1.2 g%B2.1.2 h%B2.1.2;
 
 set in 0,
 set sel %B000,