print("clk_conn = clock.A") clk_conn = clock.A print("\n") print("Initialize enable") print("enable = Connector(1)") enable = Connector(1) print("Setting No of Bits to 4") print("Clock frequency is 10 Hz") # Initializing the counter print("\n") print("Initializing RingCounter with 8 bits and clock_conn") print("b = RingCounter(8, clk_conn)") b = RingCounter(8, clk_conn) print("Initial State") print(b.state()) print("Triggering the counter 8 times") print("for i in range(8):\nb.trigger()\nprint (b.state())") for i in range(8): b.trigger() print(b.state()) print("\n") print("Calling the instance will trigger") print("b()") b()
clock = Clock(1, 50) clock.start() # In[3]: # Initialize enable enable = Connector(1) # In[4]: # Initializing RingCounter with 8 bits and clock b = RingCounter(8, clock) # In[5]: # Initial State print (b.state()) # In[6]: # Triggering the counter 8 times for i in range(8): b.trigger()
print("clk_conn = clock.A") clk_conn = clock.A print("\n") print("Initialize enable") print("enable = Connector(1)") enable = Connector(1) print ("Setting No of Bits to 4") print ("Clock frequency is 10 Hz") # Initializing the counter print("\n") print("Initializing Johnson with 8 bits and clock_conn") print("b = JohnsonCounter(8, clk_conn)") b = RingCounter(8, clk_conn) print ("Initial State") print (b.state()) print ("Triggering the counter 8 times") print("for i in range(8):\nb.trigger()\nprint (b.state())") for i in range(8): b.trigger() print (b.state()) print("\n") print("Calling the instance will trigger") print("b()") b()
# Clock frequency is 50 Hz clock = Clock(1, 50) clock.start() # In[3]: # Initialize enable enable = Connector(1) # In[4]: # Initializing RingCounter with 8 bits and clock b = RingCounter(8, clock) # In[5]: # Initial State print(b.state()) # In[6]: # Triggering the counter 8 times for i in range(8): b.trigger() print(b.state())