logic_sim v0.1.4 LogicSim.Node.And View Source

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

Link to this section Summary

Functions

Returns state of server.

Links this nodes output to the input of another node.

Tells this node to set its input to the given value

Starts the node with the given options

Same as start_link/1 but raises on error.

Link to this section Functions

Link to this function

calculate_outputs(state, input_values) View Source

Callback implementation for LogicSim.Node.calculate_outputs/2.

Returns state of server.

Also can be called from LogicSim.Node.get_state if you don't know the node type.

Link to this function

set_node_input(node, input, input_value) View Source

Tells this node to set its input to the given value

Will be called by another node when its output is changed while linked to this input.

Starts the node with the given options

Possible Options:

listeners: a list of process pids that should be notified whenever the state of the node changes. Listener will receive {:logic_sim_node_state, this_nodes_pid, this_nodes_state}

Same as start_link/1 but raises on error.