[REMOVED] Library

Removed

Basic Logic Gates Library

symtab

Introduction

Logic gates are elementary building blocks for any digital circuits. It takes one or two inputs and produces output based on those inputs. Outputs may be high (1) or low (0). With this library, you can play with a few basic gates. (My final goal is to try and use them in order to build more complicated components (such as multiplexers). You can get the library here


How to start using this library

Do something like this

local library = require(game.Workspace:FindFirstChild("LogicGatesLibrary"))

Documentation

Note: a and b can only be assigned the values of 0 and 1.

  • AND(a,b)
    The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high.
  • NAND(a,b)
    The outputs of all NAND gates are high if any of the inputs are low.
  • OR(a,b)
    The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high.
  • XOR(a,b)
    The ’ Exclusive-OR ’ gate is a circuit which will give a high output if either, but not both , of its two inputs are high.
  • NOR(a,b)
    The outputs of all NOR gates are low if any of the inputs are high.
  • NOT(a)
    The NOT gate is an electronic circuit that produces an inverted version of the input at its output.
  • XNOR(a,b)
    The ’ Exclusive-NOR’ gate circuit does the opposite to the EOR gate. It will give a low output if either, but not both , of its two inputs are high.
  • IMPLY(a,b)

End

2 Likes

This seems a little excessive since all the necessary and useful logic gates are already (as they should be) built into Lua.

For example:

  • AND - if 1 == 2 and 3 == 4 then...
  • OR - `if 1 == 2 or 3 == 4 then…
  • NOT - if not 1 == 2 then...
1 Like

Could be an interesting game idea to teach children about logic gates, but this module doesn’t seem very useful, considering these are all luau globals! Thanks for the resource though!

1 Like

Interesting idea although I see little to no real world use for using logic gates when native lua if statements and logical operators do the job fine. Not trying to hate on this I am just saying I would probably never use it as I don’t see any case which this is easier than using if statements and logical operators instead.

1 Like

I think this is more fitting for #help-and-feedback:creations-feedback

doesn’t seem useful