logic_sim v0.1.4 API Reference

Modules

LogicSim allows you to create logic circuits comprised of nodes such as switches, lightbulbs, and logic gates. See LogicSim.Node for details on creating and managing nodes.

A node is the basic building block of LogicSim. A node is a GenServer that has 0 or more inputs, and 0 or more outputs. Each node keeps track of which nodes are connected to each of its outputs. When an output changes the node sends a message to its connected nodes telling them what value to set on the input they are conneted to.

Simple and logic gate. Two inputs, output is true if both inputs are true, false otherwise.

Simple lightbulb representation. Has one input and no outputs.

Simple not logic gate. One input and one output. Output is opposite of input.

On/Off switch representation. No inputs, one output. Remembers current state and can be toggled, which inverts its output.

Simple or logic gate. Two inputs, one output. Output is true if either (or both) inputs are true.