IBM TJ Watson Research

IBMBinaryCounter

IBMBinaryCounter.mp4

Description

The binary counter uses the flipflop technique presented in IBMFlipFlop to create a toggle. Basically this toggles from 1 to 0 at each input event. In order to create a binary counter though we need to half the events propagated at each stage; simply connecting the flipflops in a sequence will not work as they are event driven (not logic level driven).

To half the events we use the fact that a TimeSensor will not forward certain events when active. So by using it's enable field and routing the same event that enables the TimeSensor also via another later path (defined by a subsequent route in the scene) to another eventIn on the same TimeSensor we can create this divide by 2 effect. Specifically the output from each stage goes two ways to the next stage; first to the enable of the TimeSensor and then, via a valuator to the cycleInterval. Only when the enable is false does the cycleInterval event propagate through the TimeSensor.

The net effect is a binary counter. The input clock (a looping time sensor) to the chain of flip flops could be altered from the setting of one second that is used in this test - the time sensors cycle intervals in the chain are not related to that clock time. Ie to speed up or slow down the counter only the input clock source needs to be altered. The test sample has a fixed one second period clock - to change this the test case would have to be re-compiled. A facility to alter the clock rate from the scene has not been provided - that could be done - but since the purpose of the test is to show this counting, via specified behavior of TimeSensor to no propagate events under certain circumstances, the test has been kept simple with the fixed rate clock.

Screenshot

Snapshot taken while running.



Back to main index