Note This is a web-version of a tutorial chapter embedded right into the XOD IDE. To get a better learning experience we recommend to install the desktop IDE or start the browser-based IDE, and you’ll see the same tutorial there.

Flip-flops

Screenshot of 010-flip-flop

You can control the behavior of many nodes with pulses. A very useful node is flip-flop. It acts like a virtual switch, whose states can be controlled by pulses. A pulse on SET turns the stored MEM value to true. RST resets MEM to false. And a pulse on TGL inverses the MEM value.

The patch shown here toggles the output boolean value each second.

Exercise #

Let’s experiment with the flip-flop node.

  1. Replace clock node with tweak-pulse node.
  2. Add a couple more tweak-pulses and connect them to flip-flop’s SET and RST pins.
  3. Run the simulation, and send pulses to each pin

Observe how the MEM value changes when sending several pulses to the same pin in a row.

Found a typo or mistake? Want to improve the text? Edit this page on GitHub and open a pull request. If you have a complex proposal or you want to discuss the content, feel free to start a new thread on XOD forum.