o = Oscilloscope( (clk_conn, "CLK"), (b.out[0], "BIT3"), (b.out[1], "BIT2"), (b.out[2], "BIT1"), (b.out[3], "BIT0"), (enable, "EN1") ) # starting the oscillioscope thread - This does not initiate the recording. o.start() # setting the scale o.setScale(0.05) # Set scale by trial and error. # Set the width of the oscilloscope to fit the ipython notebook. o.setWidth(100) # In[33]: # unhold the oscilloscope to start the recording. o.unhold() # Initial State print(b.state()) # Triggering the counter sequentially 2^4 times for i in range(1, 2 ** 4):
# In[3]: # Initializing Binary Counter with 2 bits and clock_conn b = BinaryCounter(2, clk_conn) # Initializing the Oscillioscope o = Oscilloscope((clk_conn, 'CLK'), (b.out[0], 'MSB'), (b.out[1], 'LSB')) # Starting the oscillioscope o.start() # Set scale by trial and error. o.setScale(0.15) # Set the width of the oscilloscope [ To fit the ipython Notebook ] o.setWidth(100) # In[4]: # Then unhold [ Run the Oscilloscope ] o.unhold() print(b.state()) # Triggering the Binary Counter 10 times. for i in range(10): b.trigger() print(b.state()) # Display the time-Waveform. o.display()