selector test goes in opposite direction
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 31 Mar 2018 14:28:14 +0000 (15:28 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 31 Mar 2018 14:28:14 +0000 (15:28 +0100)
src/myhdl/mux.py

index 6eeba5c1d2bc20a942937acb8a6766b94ffc5341..06fa9af2cfd8af312060f36a98915953b14fc34f 100644 (file)
@@ -75,10 +75,10 @@ def mux_tb():
                         if in_c:
                             in_d.next = not in_d
                             if in_d:
-                                if selector == 0:
-                                    selector.next = 3
+                                if selector == 3:
+                                    selector.next = 0
                                 else:
-                                    selector.next = selector - 1
+                                    selector.next = selector + 1
             yield delay(period // 2)
 
     # print simulation data on screen and file