diff --git a/src/hal/components/and.comp b/src/hal/components/and.comp new file mode 100644 index 00000000000..e39571171e0 --- /dev/null +++ b/src/hal/components/and.comp @@ -0,0 +1,36 @@ +component and "Multi input AND gate"; +pin in bool in##[128:personality] = 1 "input pins, up to personality-1"; +pin out bool out "output pin; the AND of all inputs"; + +description """ +The *out* pin is set to *TRUE* if all the inputs are all *TRUE*; or *FALSE* if one or more are *FALSE*. + +The value for a unconnected pin is TRUE; so it is fine to leave a pin unconnected. + +Set the number of pins via personality. The default value is a single *AND* with 8 inputs; so personality=8. The maximum number of inputs is 128 (hardcoded). If there are no inputs specified (personality=0); then the output value +is TRUE. +"""; + +function _ "Logical AND"; + +see_also """ +*or*(9), +and2(9) +and +or2(9). +"""; + +option period no; +option default_personality 8; +option default_count 1; + +license "ASLv2"; +author "Dirk-Willem van Gulik