AND is a two-input gate that outputs the conjunction of its inputs. That is, the output is 1 only when both inputs are 1.
The code below constructs AND from a NAND gate connected to an inverter.
and.t notLeft -2 0 notRight 1 0 notRight 0 5 in a -3..-1 0 in b 0..2 0 out o -1..1 10
The following image shows the outputs for all possible inputs.
The J-tetromino of the upper inverter functions as an OR gate.
© 2023 meatfighter.com |